I created a point layer from a line using Vector geometry/Extract vertices in the Processing toolbox.

The purpose is to extract the elevation from a DEM into the points corresponding the vertices and then into the line layer.

I managed to get the elevation values on the points but I can't really figure it out how to add the values to the vertices in the line layer.

My final objective is to export a LineString geojson file containing the x, y, z values. There might be easier ways but I couldn't find any so far.

P.S. I created a z value field in the line layer, just need to copy the values from one layer to another.

enter image description here


1 Answer 1


You can get Z-values directly from your raster using Menu Processing / Toolbox / Drape (set z value from raster). This will output a new line layer: a copy of your initial line with z-Values for each vertex:

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.