Saturday, 2 January 2016

qgis - How to extract elevation values at line start and end points from a DEM?


I am new to the whole gis-experience and need your help working with QGIS.


I have:



  • DEM raster with heights (3d)


  • line-shapefile which contains the rivers (2d)


I need: heights for "start" and "end" in lines (to get them 3d) then compare that heights with "flow direction" of the lines


qgis-help doesn't really help me out. Tried searching google, nothing useful found. I am pretty sure that it may be a really simple "standard-tool" that can do what I want. However I haven't found it yet.


Edit:


well, i am looking for a solution, not important wich way. dont have any experience with python.


i was working on that problem and think i am almost ready, but there seems to be a problem:


i extracted the nodes of the lines, they got the heights from the dem-grid. i even managed to add the values of the points back to the lines, but when i check the values, the "minimal height" (or maximal) dont always have the suitable x- and y-coordinates of the point.


example: there is a line (columns: name, id, start_x, start_y, end_x, end_y). i imported the point-values (x, y, z coordinates) into the line. got 6 new columns in the table: min_x, min_y, min_z, max_x, max_y, max_z


now the min and max coordinates are mixed up and dont compare to those from the points.



my thoughts now are:



  • i delete the min_x, min_y, max_x, max_y

  • rename "max_z" and "min_z" to "up" and "down"

  • somehow i need to get the up_x, up_y and down_x, down_y from the points. maybe there is a way to do that in the field calculator like: (for up_x in table "lines") value = "x" FROM "points" WHERE "up.lines" = "z.points"


dont know if that can work in qgis or how the code should look like. maybe there is a way to manage this in python, but as i said, i dont have a clue about python.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...