Creating GPS route maps from google maps

This is an expansion of the excellent work done by Mr. Davis at his Open Source GPS HOW TO page. He has a google maps hack here that allows one to make a GPX xml file by clicking on intersections. This is a very quick way to make a route map.

I wanted to expand on his work in two ways:

  1. I wanted to fill in waypoint names for items that were left blank, and
  2. I wanted to automatically check for waypoint name duplication, because duplicates cause data to be overwritten in Etrex GPS devices.

I wrote a python script that does both things. All one has to do now is:

  1. Create a map on his website
  2. Name major waypoints on the map (I like to name intersections using the name of the street I’ll be turning on to)
  3. Save the GPX file to disk
  4. Run gpxrecode.py [inputfile] [outputfile]

gpxrecode removes the leading number and hyphen from the waypoint name. If the waypoint is blank it gives it the same name as the last one. If the waypoint is already in a cache of waypoints, it adds a number to the end of the name. The cache is maintained between runs of the program, so multiple routes shouldn’t clobber each-other’s names.

Source after the break.

Continue reading “Creating GPS route maps from google maps”