I utilised the Interpolation feature in QGIS to prepare contours from a DEM I had generated. Sometimes when contours intersect the edge of the DEM area, they run along the edge for some distance. This doesn't seem to occur all the time, but only at select locations.

Is there a method to avoid this? It seems if I cut 1m of the edge of the contour they would be perfect.

  • Contours get bad halfway through the outside cells, it is best to remove the last cell or two worth of contours - regardless of what tool you are using to generate. Esri has a similar problem but the contours just stop halfway through the last pixel, to avoid this when I do contour tiles I get one cell more than I need for the tile then clip back to the tile extent. Commented Aug 20, 2014 at 2:43

1 Answer 1


The resulting contour layer is a vector. You should be able to Clip this, by creating a third layer of a polygon which is a little inside the boundary of the DEM. Depending on the complexity, it might be quickest to make the boundary by hand, or vertorise the DEM and then apply a negative buffer to the boundary polygon, which creates a fourth layer.

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.