I'm using QGIS to work with a contour line shapefile with contour lines that are not spaced evenly (e.g. not just 100 meter elevation increase between each line). The increase ranges from a 100 meter increase to a 5000 meter increase. Is there anyway to create a DEM from this data, or do I need to find a way to regularly space the elevation data?

  • Interesting. If you need DEM for a specific location, you can find it on internet and if you from europe, you can get it from this link
    – Gakovî
    Commented Feb 1, 2021 at 6:54

1 Answer 1


I'd suggest r.surf.contour tool, which is found in the Processing Toolbox > GRASS > Raster(r.*).

Note 1) This GRASS tool can be run only when you use "QGIS Desktop 3.xx.x with GRASS 7.8.x".

Note 2) This tool requires a raster as input.

  1. A small example of uneven contours (100, 200, 300, ..., 1000, 1500) was rasterized by Rasterize (Vector to Raster) in the Processing Toolbox > GDAL > Vector Conversion . This tool produces a Rasterized layer.

enter image description here

  1. Start r.surf.contour tool.

  2. Select Rasterized layer as the input raster layer, and make sure to calculate the region extent of this layer (even though it says optional).

  3. Final output layer is called DTM from contours. The quality of the image depends on how you set the pixel size. Please note I have rasterized the contour to 300 x 400 pixels (the above image).

enter image description here

  • Thank you! I'll try this when I get some time! Commented Feb 1, 2021 at 18:17
  • Hmm, when I try this, I get a layer output that only has two sub layers instead of the 5 that you show. One is negative and one is positive, and both are the same magnitude. Not real sure where the values come from as neither of them are elevations that are represented in the contours. I also note that your contour layer has 5 sub layers, where did those come from? My contour does not have those. Commented Feb 2, 2021 at 1:00
  • 1
    @ScottCasey My contour (vector - lines) was one layer without sub-zones. What you are seeing is the gradient color scheme, and it (the class) can be any number.
    – Kazuhito
    Commented Feb 2, 2021 at 1:05

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.