4

I have some roads and some points containing elevation data. enter image description here

Obviously the data does not cover the whole area, as it was created by a surveyor. Based on this data, I need to check, whether the inclination of the roads surpasses a specific threshold.

I used linear TIN-interpolation to create a DEM and based on this the inclination - which has a lot of erroneous triangles: enter image description here

I tried IDW- and cubic interpolations, but these don't produce an output ("couldn't create layer").

Basically I either need an option/tool to create the DEM with fewer artifacts/errors, or to interpolate the data.

2
  • 1
    If you just want to know the road grade then you have the data you need. Buffer your road line and clip the DEM you have. Generate a slope raster from the resulting clipped surface. The ArcGIS TIN toolset and TIN datatype has the functionality you are asking about. The Delaunay Triangulation tool in QGIS does not allow you to include clipping and bounding polygon geometry to the triangulation in QGIS 3.4 like an ESRI TIN would.
    – GBG
    Jan 29 '20 at 16:26
  • 1
    This does not look like an appropriate interpolation method for this data. Perhaps you should be focusing on the issue of outputting a surface using another method. An IDW would not be ideal for interpolation of elevation data but, splines tend to work fairly well. They can have a tendency to produce large variances when proximal points have extreme differences but otherwise are a good option. I would suggest using the TPS tool in the QGIS - SAGA toolbox. If you are not getting output then you can post that as a separate issue. Jan 29 '20 at 18:06
4

You need points in both sides of the road to interpolate. In the process we will get also a buffer to clip the raster.

  • Create a buffer of your lines with a proper radius for a road (let's assume that 30m is a proper radius).

  • Dissolve the buffers.

  • Densify by interval the dissolved buffer, by a proper distance to get enough nodes (let's assume that 10m is a proper distance, I don't know the scale of your survey).

  • Extract vertices of the densified-dissolved-buffer.

You will have something like this:

1


Here comes the magic. We need to transfer the Z value from the survey points to the extracted points. Since QGIS 3.8, you can do it with the Join attributes by nearest tool. If you are using QGIS 3.4, let's take the opportunity to install a good plugin: refFunctions. You can install it from the Plugins menu.

refFunctions plugin adds some interesting functions to our expressions, under the Reference group.

In this case, we will use it to populate a new field of the extracted vertices with the value of one field (I called it Z) of the nearest point in the test_points layer.

geomnearest('test_points','Z')

2


Now we can make the interpolation with both layers:

3

4

The triangles remains outside the buffer, but that's innevitable.

Clip the raster by mask layer, and you will have a DEM to analize the slope of the road:

5

3
  • Thank you for your input which pointed me in the right direction. In the end gdal_grid with IDW search for nearest neighbour gave the best interpolation result. The slope analysis now gives a realistic output, though not in our favour.
    – Erik
    Jan 31 '20 at 15:11
  • 1
    Oh, and QGIS 3.8 and 3.10 have a new tool: join attributes by nearest - this works just as the plugin you recommended.
    – Erik
    Jan 31 '20 at 15:50
  • 1
    @Erik, Thank you for that information. I had not seen that new tool. I will update the answer. Jan 31 '20 at 16:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.