Export multi-destination (or dragged) route to Google Earth

Love keep adding destinations to your route, or even dragging the route to refine perfectly to your needs in the directions feature on Google Maps? But frustrated that this feature isn’t available in Google Earth?

… No, not implemented this feature for Earth (wouldn’t that be something!), but as a stop gap its a way to export your newly created directions on Maps, and open them in Google Earth! You get a freshly created folder containing each section as a separate route, ready for use as ‘one.

Multi Destination routing in KML for Google Earth

31 Responses to “Export multi-destination (or dragged) route to Google Earth”

  1. Chris Fowler says:

    This is a great tool. What I am trying to do is build an interactive map which shows the transport link in an area (buses routes). The bus routes are encoded using the TransXChange data format (xml schema). What would be really cool is if I can take a TransXChange service description and convert it to KML for display on a map. However, before I go that far, this is an excellent way for me to get kml file from routes data – even if I have to manipulate the routes by hand.

    Thanks again for all your efforts on this site. Some really great resources here.

  2. Barry says:

    I’ve never even heard of TransXChange, but doesnt look that hard to parse (looking at a few examples) – the only issue is its in NationalGrid so would need converting to lat/long for Google Maps etc. (but I have plenty of tools available for that ;)

    One thing that does occur to me, is might be worth contacting Google:
    http://code.google.com/transit/spec/transit_feed_specification.html
    as they might have or willing ot help create a TransXChange < -> transit feed convertor. And in the process KML could be a useful biproduct.

  3. Geoff says:

    Great tool, but . . . Trying create a Google Earth route of a backroads motorcycle route. When I do a simple test route of several addresses it works great. But when I try a sample of the routes I actually want to create I get an XML parsing error when I open the KML file.

    Here’s the GoogleMap route I’m trying to convert-
    http://maps.google.com/maps?f=d&hl=en&geocode=&time=&date=&ttype=&saddr=sierra+madre+%26+azusa,+azusa,+ca&daddr=34.218332,-117.854805+to:mt+baldy,+ca&mra=dpe&mrcr=0&mrsp=1&sz=12&via=1&sll=34.1767,-117.783835&sspn=0.135768,0.275345&ie=UTF8&z=12&om=0

  4. Barry says:

    @Geoff,

    Good catch, it wasnt coping with the & in the address. I’ve fixed it and it now copes with your route just fine :)

  5. Barry says:

    @Chris,

    Just found this
    http://code.google.com/p/googletransitdatafeed/

    which reportedly has a TransXChange convertor

  6. Ray white says:

    Your program is great. Could you help me with a problem and tell me what I’m doing wrong. When I run the program, and then save the new.kml file into a folder it works with no problem in GE, but when I try to convert the .kml to a .gdb file through Babel [ GPSBabelGUI.exe ] it doesn’t work and only shows the file as 1 k……

    Thank You
    Ray

  7. Barry says:

    @Ray

    I think its that the KML file produced doesnt contain any content, but rather a set of network links, which tell GE (or Google Maps etc) where to find the actual ocntent on Googles servers. Is quite probably that GPSBabel doesnt understand such links and expect the content to be in the file.

    The easiest workaround I can think of is to probably open in in GE, and drag the contents of old directions (one by one) to a new folder – if you drag the top level you simply move the link – and then save this new folder, this should actully save the content.

    HTHs

  8. Ray White says:

    Barry

    That did it……….by creating a new folder and transferring the instructions

    So your saying that your program creates a kind of “shortcut” and that explains the folder and the subfolder having the same title when opened in GE

    Is there any way to eliminate that step

    Thank You for the program and explanation
    Ray

  9. Ian Chappel says:

    Hi Barry,

    That is brilliant! Just what I’ve been trying to achieve. Surely Google must before too long provide either d+d in GE or the ability to get info out of GM? As you say, it is a gap in functionality.

    On another note, I am trying to recreate some old “tracks” for my website, but have them in an old Autoroute (*.AEU and *.AGB) format. In fact I only need to extract the waypoints. Do you have a utility that can retrieve/convert them? (I don’t have the old programme). The file is zipped at http://www.aslc43.dsl.pipex.com/Misc/old_autoroute.zip if you’re able to take a peak. I’ve previously used an excellent utility at http://mcrenox.com.ar/gps/ to extract info from Autoroute 2001+, but it can’t do earlier versions (I have asked!).

    Sorry, the original purpose of my message was to say thanks, not ask for more!

    Ian

  10. Ian Chappel says:

    UPDATE:

    I’ve looked into the Network Links in your KML output. It seems the same can be achieved, by taking the “Link to this page” url from GM, and simply changing the “&z=10″ (or whatever zoom factor) at the end to “&output=kml”.

    The revised url works either straight into your browser’s address bar, or as the location of a Network Link in GE.

    The difference is, the Path will be in one segment, and the directions will be in one list (i.e. there’s no splitting at via points).

  11. Barry says:

    @Ian
    Have you seen http://www.gpsvisualizer.com/ that might have a conversion – in particular has a web interface to GPSBabel.

    Yes as you seen it just creates a bunch of links – so gets a seperate ‘routing’ per segment, the normal kml output doesnt seem to fully support multiple points (it does partically tho)

  12. Ian Chappel says:

    Thanks Barry, I’ll have a look at http://www.gpsvisualizer.com/.

    The method I described (modifying the GM url) definitely does preserve the routing of GM in GE. My purpose was to generate a path (simulated tracklog), which was a lot easier in GM. I also wanted it in one segment.

    It’s very odd that GM’s routing doesn’t display the “View in Google Earth” button.

  13. Ian Chappel says:

    Further to my last post, it seems that it preserves routing using via points (i.e. dragged ones, the little white circles). But doesn’t work with Adding destinations (i.e. markers ‘C’ and greater).

  14. Barry says:

    yes noticed that. I’ve used it before (before got round to writing the above app), you can convert the points to ‘via’ points with the ‘via’ param, i added basic docs here http://mapki.com/wiki/Google_Map_Parameters

    Update: Which also reminds me this app silently disgards the via information, and makes them all full stops – it could be sorted I suppose.

    Also unrelated, I mentioned draggable routes in GE itself, it might soon be possible!

  15. Ian Chappel says:

    Thanks Barry.

    One other thing – have you found a decent method of transferring a route from GM (via. GE probably?) to a GPX file? I’ve done it via. a KML but just end up with lots of unconnected Waypoints and some Tracklogs(=paths). What I want is a Route!

    I’ve searched and found a few websites which purport to do this, but haven’t yet had any success. Perhaps Google will add an ‘Export to GPX’ or ‘Send to GPS’ button before long? I did see that facility available from the ‘Send’ button but I think it only works for one Waypoint at present.

    BTW GPSvisualiser wasn’t able to handle my AEU files.

  16. Candy says:

    There are two links to copy. Which one do I use? Doesn’t really matter, I guess, because I get the following message no matter what I use:

    unable to parse query, please try again

    Can you please help me, or has Google “fixed” your script so it no longer works?

    Thanks.

    Candy

  17. Barry says:

    @Candy

    Only one of the boxes is a Link, the top one (as it says on the instructions in the Google Maps Group post)

    I’ve just tested it now and it working for me. What map are you using? Are you simply viewing directions at the time you click the ‘Link to this Page’

    If you can please paste the link you are trying here.

  18. Barry says:

    @Geoff, not exactly sure what you saying, but that link is a link to a My Map on Google Maps – so that wont export.

    You use this tool to create a KML file from a ‘Link to this page’ when viewing the directions – the other tutorial tip post mentions you can then import the KML produced by this tool back into a My Map – to save it.

  19. Bill says:

    Tried this to save a route. Got very bizarre results; maybe I’m not doing it correctly, but I followed the directions on the FAQ.

    It was a local map for Atlanta, GA metro area (to get to my daughters volleyball match from work and then home after). When I imported (follwoing directions) it was routing me through Pennsylvania…a little out of the way for what I had planned.

    Anyway – thanks for the help, but Google really needs some method for saving routings, both multiple destination and customized destination. I like a lot of what Google maps does, but saving customized routes would be a big advance.

  20. Steve says:

    Hi Barry,

    Firstly love your work on this tool – it’s what google should have written in the first place. After of course they let us use more that 24 checkpoints in a single a google maps route. But I digress…

    Currently you exporter gives us a kml with a bunch of network links in it, which is great if I am online with google earth but if I want to use it in offline mode it doesn’t look to me (unless I am missing something) like google earth caches the network routes so I’m out of luck.

    Would it be possible for your converter to ask if you want a networked linked kml output (the current functionality) or a static version?

    If the user asked for a static version it’s “simply” a case of asking google maps to resolve the next step down for the network path (it gives you a static path) and splicing the resulting kmls together.

    What’s our chances of getting you to do that? wink wink… :-)

  21. Joe says:

    1. Get your route all ready with all your waypoints, start, destination points and such.
    2. Click “Link” on the upper right hand corner
    3. Copy and paste the contents of the _top_ box into your address bar.
    4. Append the following to the end of the pasted address in the address bar:

    “&output=kml”

    without the quotation marks. This tells Google to give the contents to you in a kml file, which you can open in Google Earth.

  22. Robert says:

    Just wanted to say genius converter. I have a 6,000 mile trip planned across the western US with all 24 points used in Google Driving Directions and was thinking I was going to have to reroute everything to Google Earth after it only was reading one way point but I came across this and you have no idea how thankful I am.

  23. Paolo Cuturi says:

    I would like to create a route (c. 100miles) along the Zambezi river which I would then like to send to my GPS unit to use for navigation, distances and ETA’s etc. I want to know where ever I am on the route, how far I am from either the start or end point of the route.

    Would this tool be useful for me?

    So far I have tested it creating a very simple path in GM, yet when I click on the LINK TO THIS MAP and copy the URL and paste it into the Multi Destination Routing url box, when I click CONTINUE I get the message “unable to parse query, please try again”. I get the same message if I append the end of the Link url with “&output=kml”

    The Linked URL I am using is: http://maps.google.com/maps/ms?ie=UTF8&hl=en&msa=0&ll=-12.545096,27.877293&spn=0.01994,0.042315&t=h&z=15&msid=106489627415814544154.00046c0ece6adc1c33339

    Would appreciate any help on this.

    Many thanks
    Paolo Cuturi

  24. Barry says:

    @paolo

    no, this tool is for a route created in the ‘directions’ feature. not for one created in ‘My Maps’

    you should be able to use the kml file from the ‘view in google earth’ link directly in something like gpsvisualiser.com to convert the file to a gpx for loading into your unit.

  25. Brotherharry says:

    with this link
    http://maps.google.com/maps/ms?hl=en&doflg=ptm&ie=UTF8&msa=0&msid=113348479174783486166.0004716c8942028204da4&ll=43.285203,-71.323242&spn=4.278266,11.425781&z=7

    I’m getting unable to parse query response, I think as it’s a saved map?

    If I use the ‘view in google earth’ button from Firefox and / or append the ‘&output=kml’ to the end of the link, I can get the file into GE, but it doesn’t replicate the precise route on the roads, just an approximation using straight lines – am I expecting too much to get a precise mapping that matches GM? Are there limits on the number of way points (haven’t used vias just grabbed white circles

  26. Barry says:

    @Brotherharry

    Yes this tool is for the original directions, – not that saved to ‘My Maps’

    Google My Maps does not support export of Saved Directions and/or hand drawn ‘Snap to Roads’ – either direct to Google Earth or in a way a toll like this one could use.

    A tool could be made to work around the limiation but it would be a lot of work, and/or of dubious legality.

  27. Joost says:

    I really like this application. It enables me to plan and visualise the height of my bicycle trips.
    But as Google maps does not give route information for numerous eastern European countries, I have to use Bing maps for that region. Is there any way, or do you know an application or site that makes it possible to export and plot height data of Bing routes without an GPS device? (It has an option to send your route to your GPS)

    Joost

  28. ehg says:

    just to let you know, Barry (altgough I believe you noticed it already yourself):
    using your tool “Multi Destination Routing Toolkit” with a multi direction link as this one here:
    http://maps.google.com/maps?f=d&source=s_d&saddr=Dallas,+TX&daddr=39.639538,-121.816406+to:Seattle,+WA+to:Portland,+OR&geocode=FYuI9AEdfWg7-ilLl0V79xlMhjGPZ0f2pJvsuQ%3B%3BFcJp1gIdWVy1-ClVM-iTLBCQVDGa1URpRmUlEA%3BFfyhtgIdERyw-CkndKl9CwuVVDGRhdH25rk2HA&hl=en&mra=dpe&mrcr=0&mrsp=1&sz=5&via=1&sll=40.188375,-109.885395&sspn=18.672514,39.506836&ie=UTF8&z=5
    and importing it as
    http://www.nearby.org.uk/MultiRoute/4b52d19c7e9d1.kml
    back to GoogleMaps/MyMaps then it will not save the route anymore but will save a map with yellow points describing the directions points (the “written directions”) only:
    Here the link to the saved route using your toolkit (saved to a MyMaps):
    http://maps.google.com/maps/ms?hl=en&ie=UTF8&msa=0&ll=39.34847,-109.72335&spn=18.898853,39.506836&z=5&msid=111694179352844374460.00047d58dc234c1484f12

    BTW: I’m pretty sure it isn’t a problem of your toolkit but of any change on creating/rendering the kml file of a “get direction route”.
    Even if one tries to import the URL of a single direction route (adding before the parameter &output=kml) back to MyMaps the same happens:
    Here an single direction route:
    http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=from:Seattle,+WA+to:Portland,+OR&sll=46.565305,-122.637595&sspn=2.10352,4.938354&ie=UTF8&z=8

    and here the imported MyMaps from this URL without using your toolkit:
    http://maps.google.com/maps/ms?source=s_q&hl=en&geocode=&ie=UTF8&msa=0&ll=46.566414,-122.503052&spn=2.10352,4.938354&z=8&msid=111694179352844374460.00047d58f23566f10597a

    What gives GoogleMaps kml import on directions?
    Regards
    ehg

  29. Al says:

    Fantastic tool!!! I’ve saved all my walks for Rome.
    Thank you very much!

  30. crlinder says:

    Since the last comment was some time ago, I hope you’re still checking for comments here. I used your multi-destination script/tool for a custom bicycling map that I made in Google Maps. I was able to import the output in to the MyMaps feature of GM, but I no longer can see the route itself (normally visualized as a light purple line) and the overall distance of the route has been lost. Do you know if there is some means by which I can retain the route line and the route’s overall length?

    Thanks for your help AND for producing the script.