Tag Archives: Profiles

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

Profile based parameter control – Parameter Views and Profiles

Controlling the transition of parameters within corridor models is not as easy as it could be in Civil 3D.

  • Width can be controlled with Offset alignments/3d Polylines
  • Elevation can be controlled with profiles
  • Superelevation can be controlled with the superelevation tools
  • But slopes and grades don’t really have a specific tool that they can be controlled with.

In fact I don’t see a clear and “simple” method for managing the transition of a daylight slope at all? Although there are methods that I discuss in this post here. They are still convoluted and cumbersome to setup.

So how does one create this sort of daylight transition in Civil 3D? vvv

Well I have a very simple idea. “Parameter Views” and “Parameter Targets” which can control everything!

So basically a “parameter view” can be placed directly above or below a profile view and “parameter profiles” can be drawn on this view that represent the desired values or grade,width,slope etc.. This process is very similar to the management of superelevation, except parameter views can control everything!

The other change to make this a lot simpler is to upgrade all the generic subassemblies to have the ability to have its parameters overridden in a relative fashion. Although it’s possible to do this in the assembly properties, it is cumbersome and not straightforward as discussed in my post here. (additional links have to created, crazy profile views where elevation = slope or grade etc etc..)

I am aware that this can be achieved using Custom Subassemblies. But such a simple change would make life a lot easier for even the basic user. Plus custom subassemblies don’t travel inside the dwg!!

Particularly useful as parameters get more complex and difficult to visualise!

Loading