Add to Technorati Favorites Innards of KML files - gross (seriously)
..................................
the blog@spencerwilliams.net

Innards of KML files - gross (seriously)

January 13, 2008 12:27 by Spencer

Compared with GPX files, KML files are ugly - at least when they are saved by Google Earth.

Look at this file:  GPX File

and compare it to this:  KML File

The KML file is XML, but when it comes to coordinates it just craps them out in one HUGE coordinates tag.  Take a close look,

-97.82383400000001,30.275435,267.383911

The 3rd number in the comma-delimited string (I thought that went away with XML?) is the elevation.  Not very pretty.  Compared with the GPX format:

- <trkpt lat="30.266583" lon="-97.823150">
  <ele>182.691</ele>
  <time>2007-12-20T21:46:55Z</time>
</trkpt>
Very pretty.  Unfortunately the schema of GPX files doesn't lend itself to doing much more than recording tracks and waypoints.  It's a file format made for GPS units only.  So instead of crafting a more difficult regExpression to remove the elevation data out of the KML file, I just regEx(^ *<ele>.*<\/ele>) to remove the elevation data from the GPX file before editing it in Google Earth and saving it as a KML file.

Related posts

Comments are closed
 
Blog Information Profile for williasp