I am working in QGIS 2.18.0.

I have a problem regarding calculation of line lengths in combination with raster files, to be precise with DEM raster.

There is not a problem to calculate the line lengths (vector layer), but this calculation assumed the surface to be flat (or not?). By doing this that way I will calculate the length of the "cathetus", and I need the length of the "hypotenuse".

Is there any add-on or is there any formula to calculate the line length that incorporates the change in the altitude?

  • No one? Is the question trivial or there is no solution?
    – Josip G
    Commented Feb 10, 2017 at 12:20

1 Answer 1


There is a SAGA Profiles from lines tool, which is accessible from QGIS Processing Toolbox | SAGA | Terrain Analysis - Profiles.

enter image description here

Just give it your DEM (raster) and the line (vector) layers. It will return a new point layer (Profiles) in which attribute table you will find DIST_SURF field. It shows the cumulative length following DEM surface (your "hypotenuse") from the startpoint.

enter image description here

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.