Creating a vector profile in QGIS

hb_

This follows a presentation I gave in 2016 at the QGIS Southwest user group at Hertford University. Of course I was meant to write it up then but with moving jobs I forgot  until a fellow user was having trouble with profile outputs so here is the process I use.

There are a number of plugins required for this:

QProf (for creating the profile and output – you could also use the Profile plugin)

Points2One (to create the vector profiles)

I also had a DSM and DTM and the process I explain uses both.

The area for the example is the Humber Bridge (shown above) and the DSM and DTM are open data from the Environment Agency 1m LIDAR.

PROCESS:

Load the DSM and DTM. Locate the area for your profile and either draw a line (I used a scratch layer) or use an existing line layer. I digitised a line along the centre of the bridge from one side to the other being careful not to stray either side – the white line in the figure below. The figure also shows the DSM layer with the DTM below it.

fig1

I don’t intend to go through the use of the QProf tool I figure you can do that yourselves but it is easy to use and has many options. Below is an image of the profiles from the line layer. You can see the bridge deck and piers quite clearly also the banks and water surface:

qprofprofile

QProf allows you to export in many formats, I choose csv and I create a separate csv for both the DTM and DSM.

Once you have saved the csv files, open it in QGIS using the ‘add csv layer’. You should see 7 columns of figures:

  • ID
  • X
  • Y (I’m doing this in BNG (EPSG:27700) I have not tried it in any other)
  • cds2d (this will be our ‘X’ axis)
  • z
  • cds3d
  • dirslop.

Now here is the bit that you have to get right: we don’t want to use the ID, X or Y as this will put out profile over the map, we want to have a two dimensional view but in the map window so forget about these.

We use the ‘cds2d’ values as our X axis (coordinates) – specify these in the open dialogue.

The ‘z’ column becomes our ‘Y’ axis (coordinates) – specify these in the open dialogue.

The csv will be added to QGIS – you won’t see it in the window because we have transformed the coordinates so that it is in the very lower left corner of the BNG BBox.

Select the layer in Layer Panel and zoom to it, you should see a series of points. Do the same process for both the DTM profile and DSM profile.

Creating the profile lines.

When you are zoomed to the point layer you can transform them into lines or polygons using the Points2One plugin which creates shp files, this process is self-explanatory. Keep the point files as the height data is not retained in the shp files and you can play about with the points to make them vertical lines based on the height value – have a go and see what you can do.

Below is the finished profiles for the Humber Bridge and water/banks, obviously I’ve coloured the water line to look a little more authentic.

result