Tag Archives: multiple

QGIS – Creating Longsection Profiles along lines at a specified interval

There are many analysis applications that require long section data or profiles to perform 2d sectional computations. Getting this data seems to be tricky for a lot of these users, so in this tutorial I want to share a method that’s free and easy using QGIS (2.18.4 when I wrote this).

Watch the video here if you’re feeling lazy.

Prerequisites

  • Vector Data for lines (SHP file, Excel Start/End Coords)
  • Raster Data (Geotiff(s)/Esri Grids etc.) contain desired elevation data. You can use multiple rasters if desired for geology etc,
  • QGIS Version >2.18
  • “Locate Points Along Line” – Plugin Installed (demonstrated in video)

Process

In the image below we have a series of lines that we wish to extract elevation data along.

Typically we will start with data that looks like below, its really important that we have at least

  • Easting and Northings of Start/Ends or vertices.
  • A group field to determine which points belong to which lines
  • And an order field to determine which direction the lines is drawn in.

Save this file as a csv somewhere

Now click the big comma on the left to load a csv in QGIS

Ensure “comma” delimiter is checked, “First Record has field names” is checked. (typically it does) and that the X field and Y field are choosing the correct column for geometry, this typically happens automatically.

Finally check the output at the bottom to determine its write.

Very important to note here that you will need to then specify the coordinate system(CRS) this data is in. Right click the layer and select “Set Layer CRS”

Type in the filter to find the correct CRS

All the points have come in but we now need to connect the dots

Open the Toolbox (Ctrl+Alt+T)

Search for “Points To Path” in the toolbox and double click to load

Specify the layer that contains the points, ensure the group (line ID) and order(numbers to determine line direction) fields are selected correctly. Then chose a place to save the shp file.

We now have lines but we need a raster to get elevations from

Either “Drag-Drop” in the Geotiff/Esri Grid etc. you have or select the add raster button on the left

Double check the raster covers the extent of the lines! You may need to assign the CRS for this later as well.

We now have everything but the points at the desired interval to get elevations from. We now need the plugin “Locate Points Along Lines”. Install from “Manage and Install Plugins…” if you don’t have it!

Choose a name/interval spacing and ensure “Keep Attributes” and “Add Endpoints” are ticked on. Then hit run.

Check that you have the desired results and the end points

Finally we need to add the elevations to the attribute table of these points. Right Click on the layer and select “Attribute Table” and you will see current there is no elevation data column.

In the toolbox again search for “Add Raster Values to Points”

Ensure you select the 0.5m interval points layer you created. Chose the rasters to process and also chose a place to save the resulting layer.

Remove the old layer that doesn’t have elevations

Right click on the finished layer and select “Open attribute table”

You should be able to see the elevation column at the end.

Select the top left corner of the attribute table and the press “ctrl+c” to copy all the data out

Then just past in excel and clean as required

Loading

REPLACEOBJECTWITH – Replace a C3D Object Geometry/Data with another C3D object’s Geometry/Data of the same type

I would like to see this command available for every civil 3d object. In both the toolspace and on right click menu’s/context sensitive ribbon. This is similar to the way styles can be replaced with another style in the settings tab. But instead, the C3D object would be replaced with the geometry/data of another Civil 3D objects. But more importantly, all the links would be maintained.

image003image005

Example – Corridor Modelling (replacing objects instead of retargeting)

This would be particularly useful with corridor modelling. As it would mean targets would not need to be respecified, just the geometry of the target object is replaced and then the corridor can be rebuilt.

So for example below, I have a corridor that targets a feature line, this feature line is used as a conditional horizontal target as well as a target for its horizontal position and vertical elevation.

There are maybe 15 regions that use this one feature line and each region has 4 targets each. Some of the regions use a different subassembly. So using the “Match Parameters” command is not going to work.

Using the “replace object with” would solve this in two clicks. Instead of many clicks in the target parameters box.

Other Uses

  • Replacing Design Profile Geometry
  • Replacing Alignment Geometry
  • Replace Surface geometry with another surface. (rather than promoting and pasting in)
  • Replacing Point Data or Point Groups with another point group.
  • The list really goes on..

The Current Style Replace with.

Not available on all styles. But useful none the less.

 

Loading