Friday, July 8, 2011

How to convert Google Maps to GPX file

The best tool to do that is the bookmarklet GMapToGPX. But after recent (June 2011) changes in Google Maps,  it stopped to work with maps created as "My Places" (aka "My Maps"). Until the author updates the bookmarklet (I hope it will be possible with the new Google Maps), there is a simple workaround (I found it here):

  • Take a link of your map from the Google Maps web site. This link is either directly available under a small "chain" image (works in Google Chrome browser but not in my Firefox), or in the text of email created by the "send" image (works in all browser I have tried)...
  • ...and add to it: "&output=kml". Then convert, as with GMapToGPX before, the resulting KML file to a GPX file using an excellent GPSVisualizer.
The created KML file may have (usually has) some (formatting) HTML tags in its waypoint description fields. The GPSVisualizer converts correctly these tags into formally correct GPX file. For example, changing all "<" characters to sequences of "&lt;". But very often these HTML formatting tags are not recognized by the software using such GPX file (e.g. Maverick map software on Android), and are displayed as normal text which does not look correct. Therefore, I am using a small Perl script that first removes these tags from the KML file and only after that I fill the updated KML file into GPSVisualizer. The script "update-kml.pl"can be downloaded from here and one can use it this way:
perl update-kml.pl < input.kml > output.kml

1 comment:

  1. Hi, I would also suggest another free conversion tool for creating gpx files or kml formats, kml2gpx.com is a fast and simple way to generate way points or tracks. Have a look!

    ReplyDelete