QGIS – Displaying Elevation Profile and Storing DEM Elevation in KML Line

elevationprofileqgis

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.

Best 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

Related Question