I’m trying to interpolate elevations from contour lines (~70000 at 1m intervals, spanning ~20km^2) in QGIS. 

When I interpolate using Inverse Distance Weighting (IDW) in the Interpolation plugin it uses all contour lines rather than just the adjacent contours?

Using the GDAL Raster plugin (inverse distance to a power) also appears to use all contours and treat the contour lines not as lines but as points?

I also tried Triangular interpolation (TIN), treating the contour lines as structure lines, but it crashes QGIS, probably because of the number and density of contour lines.

For powers below 5, using the GDAL raster plugin, the resulting DEM is very noisy, and the contour points tend to become local maxima or minima

i.e. for grid cells that have a contour line running through them, but do not contain the points that define the contour line, the interpolated elevations are shifted towards the average elevation of all contour data, rather than being assigned the elevation of the contour line running through them; this is because the interpolation is unnecessarily accounting for the elevations of every single contour point (though weighted by inverse distance).

While this problem is reduced when I use IDW with higher powers, relatively flat regions start to look like nearest neighbor interpolations - like steps, rather than like a large region with a small incline.

From other posts, it sounds like the GRASS r.surf.contour algorithm has similar problems.

Using a search radius is better, but it still smooths out features smaller than the search radius, and still allows contours not relevant to a grid cell to impact its interpolated elevation. 

Is there a way in QGIS to interpolate using only the contour lines immediately adjacent in all directions?

What’s the best practice for interpolating from contour data in QGIS such that contour data is in fact treated as contours, rather than as one large set of points or lines? 


1 Answer 1


I come from the AutoCAD / ESRI world and am not familiar with the tools in QGIS. However I've created many surfaces from contours.

In order to create a surface from surface contours requires some additional processing. First you must weed and supplement the contour points See https://knowledge.autodesk.com/support/autocad-civil-3d/learn-explore/caas/CloudHelp/cloudhelp/2017/ENU/Civil3D-UserGuide/files/GUID-523368FB-BF6D-4E7C-8E38-7BA9A2B7E38A-htm.html

Second, you must create break lines for the bottom of valleys, ridge lines and other breaks in the surface to avoid artificial flat areas.

TIN then gives the best results for topography using the contour points and break lines. Smoothing the resulting contours make them prettier but not more accurate.

ESRI's explanation of contouring statiscal and tographic data: https://www.esri.com/news/arcuser/0704/files/interpolating.pdf

  • 1
    The question is specific to QGIS and how to do it with the functions it includes
    – jberrio
    Commented May 13, 2021 at 1:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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