Getting Elevation Data Out of Google Earth

google earth

If you trace a line in google earth then save it out as KML it will not have altitude data. This annoying because often GPS logs are not really accurate enough to make a nice map. I was the wanting to plot a section (elevation chart) from the traced KML. For example the site tracks.org.nz has a lot of these traced KML files on it.

It turns elevation data can be extracted via the google earth api. (god knows why its not written out to the KML in the first place). So I wrote a script to automate writing the elevation to KML files.

It needs the following to be already installed.

 

It seems the pygoogleearth project is a bit bung and requires a minor modification to work

Replace this line:

return gehelper.point_dict_from_terrain_point(terrain_point)

With this line:

return terrain_point

Script attached (rename to ele_lookup.py)

 

The script works by using the COM api in google earth and "drives" the camera round the course of the KML its kinda funny to watch. (for low values of "funny")

AttachmentSize
ele_lookup.txt2.75 KB

you should put it on github

you should put it on github

Done, Get elevation data

Done, Get elevation data script on github... here

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Insert Google Map macro.

More information about formatting options