I have extracted nodes from a line shapefile. On these nodes, I have extracted altitude values from a raster DEM using SAGA 'Add raster value to point'.

I want now to make the inverse of the first operation, i.e. getting the original lines again, but with the new altitude on each of their points (so stored in the geom).
I obviously can't make a join on attributes. And a union doesn't keep the fields of the points.

How would you do that, if it's possible?

  • Join attributes by location. Also, why can't you join on attributes? Usually there's an option to create nodes with the polylines id. – caiohamamura Jul 26 '16 at 23:09
  • Yes I've got the following error: Algorithm Join attributes by location starting... 5L See log for more details – s.k Jul 26 '16 at 23:14
  • Did you extracted the nodes with Extract nodes tool? If so the id from lines and nodes are the same, so you can join them by their attributes. If you want to make some kind of pre-processing then you should export as table and process it, like grouping same id nodes using the average elevation. Then add the table and join with the lines layer. – caiohamamura Jul 26 '16 at 23:18
  • That's the point, I need exact Z value for each node of the lines. So it's only possible in the geom, AFAIK. – s.k Jul 26 '16 at 23:21
  • But how do you want to join the attribute in the line feature? There will be at least two nodes for each line, you want to get a mean value from those nodes or what? – caiohamamura Jul 26 '16 at 23:27

If I am not misreading, overall goal is getting 3D Line Shapefile derived from the DEM.

Then GRASS v.drape may be one of alternative approach, which has become accessible through QGIS Processing Toolbox.

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.