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.