Wednesday, 29 June 2016

Displaying elevation profile and storing DEM elevation back to KML line using QGIS?


When I draw a track in Google Earth, for example along a road, I can right-click it to "Show elevation profile", and it displays a 2D plot of distance vs elevation. However, if I save the KML, the elevation coordinate is always zero.



So let's suppose I import the KML LineString in QGIS, and I have a SRTM DEM layer, how can I:



  1. Display an elevation profile (distance along road vs DEM elevation at point);

  2. "Replace" the (zeroed) elevation profiles of KML by DEM elevation values, so that I could export back to kml and have elevation "hardcoded" in the LineString.



Answer



Download and use a plugin called "Profile tool".



  • load your grid

  • load your polyline (layer)


  • run plugin (Plugins/Profile tool/ Terrain profile)

  • in field called "Selection" (below the profile chart) choose "Selected polyline" and choose your line


Profile tool - Terrain profile


To simply get all grid values along the line switch tab from "Profile" to "Table" and there you can copy all values to clipboard and paste to text editor / table editor...


Profile tool - Terrain profile as values


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...