2009-11-29

How to download KML data from Google My Maps

I had put a lot of time into a particular custom map under Google "My Maps" and I wanted to make an offline backup of the data. I clicked on the "View in Google Earth" button when viewing my Google "My Maps" map and it downloaded a KML file which I could open in Google Earth. However, when I opened the KML file in a text editor I saw that it didn't contain any actual map data but instead just had a http URL pointing back to Google Maps. After some experimentation I discovered that I could download the actual map data by taking the URL from inside the downloaded KML file and changing each instance of "&" into plain old & and then pasting the edited URL into my browser address bar. This returned a real KML file with real data.

Incidentally, you can display a KML file on Google Maps by uploading the KML file to any webserver and then putting the http address of the file in the Google Maps search box and hitting enter. Google maps will then display the KML file placemarkers and paths on Google Maps.