GM2TT Explained

This explains how the Google Maps to Tomtom Iternerary converter works and much more background. In an ideal world this page would not exist. Rather Google would give the ability to download not only the .itn files for the Tomtom, but ittineraries for many more devices.. Untill then I will try to keep up with their code

This is the second version of this script and is a complete re-write. Where the previous version analyzed the URL, this will use the xml output from Google Maps and turn it into a .ITN version by processing the file. I have to thank this to A.S. Budden who has pointed out the fact that adding "&output=kml" to the URL gives you a XML file that you can put through a XML parser.

How does this all work?

Google has added the ability to change your route on Google Maps. The way this works is by dragging the route you have made as explained in the video below.

When you are ready, click on the word Link right above the map on the right side. The link that says Paste link in email or IM is the one you need to copy into this page. This will turn the page into an .itn file that you can save onto your PC.

After downloading the route file (.itn type) to your computer, connect your device (or memory card) to your computer and copy the file to the itn folder on your memory card. If no itn folder exists, you can easily create one. On your TomTom, select Itinerary planning from the main menu and a folder named itn will be created automatically.

Cross-border routes may require you to switch maps. If your maps are on different memory cards, copy the .itn file to both cards. If any of the waypoints on your route are outside the active map, they will be shown crossed out.

To start navigating, go to Itinerary planning on your TomTom. Select Options, Load itinerary, select the file you just copied and select Done. Generally, using the shortest route-calculation will give you the best results. However, when you want to avoid motorways or optimize a route for cycling or walking this is usually possible as well.

Technical explanation

The code for the main page can be found here. The XML Parser can be found here and is orginally for http://www.hansanderson.com/php/xml/

The script takes the URL and adds &output=kml to the URL. This wil turn the URL in a file called maps.kml which is saved at upload/maps.xml.

The parser takes out the needed information, like name and coordinates. The names of the streeats are actually the route descriptions last word. Also the longitudes and latitudes need to be converdted into the right numbers for the Tomtom. The parser is run three times, to make it easier to have different first and last lines.

To make it possible to download and show content at the same time, I used a stupid trick. I made an iframe with the size of 0x0 and no border with the file file.php of which the content can be seen right here.

Still to do

  1. Testing it on the Tomtom
  2. Save data and show it
  3. Split up the files for easy download
  4. Test if the link is indeed from Goole
  5. Clean up the temp file
  6. See if TinyURL can be used
  7. See if comments are possible in ITN files
  8. Put the URLs in a database, so others can enjoy them
  9. Use the Google Maps Api to do everything on one page

~