August 28, 2007

Convert KML to GPX

Yesterday I had an urge to do some coding. I've taken a couple weeks off and I find that idle hands lead to an idle mind. So, I spent a couple hours creating a VERY simple tool that will parse a KML file, saved from Google Earth, and format it as a GPX file.

So what good is that?

Lots of mapping tools will read GPX, but only Google Earth with read KML. The original problem and why I created the tool can be read here.

Some Details:

This is not a robust tool. What this tool does is looks at the polyline from a KML file. Anyone who enjoys viewing trail data on the web, knows that the polyline is where the bulk of the trail beta lies. On that line you have latitude, longitude, and elevation data.

What I did is parse the KML file and pull the data from the polyline. I then reformat the data and download a GPX file to the users computer. This allows me to use the KML data in a lot of other mapping software that doesn't import KML, but does import GPX. More importantly, it allows me to upload the GPX file that was created from a KML file to TrailCentral, which was my original reason for creating the tool.

I left the tool active, because I figured there may be others that would find a simple tool that converts a KML file to a GPX file useful.

3 comments:

ChrisK said...

Are you interested in a KML that your program doesn't seem to parse?

ChrisK said...

(I'll be happy to email it to you.)

Unknown said...

Hi. For the last weeks I used an online converter. I find it easier and faster...here it is : http://kml2gpx.com/ let me know what you think of it!

"Pennies do not come from heaven. They have to be earned here on earth."
~Margaret Thatcher