KML import for My Route

Discussion about the Geocaching Australia web site
Post Reply
User avatar
Tardis
3000 or more caches found
3000 or more caches found
Posts: 24
Joined: 04 June 14 11:16 am
Location: Tasmania

KML import for My Route

Post by Tardis » 19 June 16 8:18 pm

The instructions for creating a KML file in Google Maps to load into My Route listed at http://wiki.geocaching.com.au/wiki/My_Route I believe no longer work since GMaps was severely reworked last year. I have searched for a viable alternative to translate a route set in GMaps saved in KML format and believe that http://www.gpsvisualizer.com/map_input?form=googleearth may offer a solution. By pasting the Google Maps URL of the preferred route into the “provide the URL of data on the Web”, accepting defaults for all other fields & creating a KML file produces something that loads fine into (for example) Google Earth - as you would expect.

However GCA import spits the dummy with errors such as:
Warning: Invalid argument supplied for foreach() in /var/www/site/gca/include/gca_route.php on line 25
Warning: Invalid argument supplied for foreach() in /var/www/site/gca/docroot/my/route/index.php on line 868

What chance KML files in the format produced by GPS Visualizer can be accepted by GCA? Alternatively what other means are available for getting a route (either between 2 towns or 2 caches via a selected route) into a format that is acceptable now that the GMaps option is defunct?

User avatar
caughtatwork
Posts: 17013
Joined: 17 May 04 12:11 pm
Location: Melbourne
Contact:

Re: KML import for My Route

Post by caughtatwork » 20 June 16 9:47 am

If you can write up the instructions, I'll follow them and update the site to allow the format from GPS Visualizer.

User avatar
Tardis
3000 or more caches found
3000 or more caches found
Posts: 24
Joined: 04 June 14 11:16 am
Location: Tasmania

Re: KML import for My Route

Post by Tardis » 20 June 16 11:36 am

Great news caughtatwork. Here's the steps to follow. I've retained the existing wording of the wiki where possible. To avoid any confusion I won't make the changes there until you're happy with the back end.

Code: Select all

==Creating a kml file to load as your My Route==

* Go to [http://maps.google.com.au Google Maps].
* Click on the Directions icon (blue diamond).
* Enter your start location on the first line. This can be as specific as a street number and name, the coordinates of a cache, or generic like a suburb / locality.
* Enter your end location on the second line. This can be as specific as a street number and name, the coordinates of a cache, or generic like a suburb / locality.
* Alternatively you can click on the map to set your start and end points.
* You can change any of the intermediate points of the route determined by Google by moving your mouse over the route line and dragging the line around until the route fits where you want to go.
* If you make a hash of a particular route it is easier to start again rather than try and fix the route.
* Try to keep routes to a reasonable distance. It is unlikely you will drive from Melbourne to Brisbane in one day, so make multiple routes based on where you will stop. Shorter routes will return caches along that route faster and will keep the load on the website reasonable.
* Once you are satisfied with your route, click on the URL field at the top of your browser (the entire string should be highlighted) and press Ctrl/C to copy to the clipboard. It will be a long string commencing "https://www.google.com.au/maps/dir/..."
* Open a new tab in your browser and go to [http://www.gpsvisualizer.com/map_input?form=googleearth GPS Visualizer].
* Under General map parameters, change the Output file type from .kmz (zipped) to .kml (uncompressed) by clicking the drop down.
* In the field at the bottom of the form headed "Or provide the URL of data on the Web:", press Ctrl/V to paste the contents of the Google Maps URL you copied above.
* Leave all other fields on the form at their defaults & click the Create KML file.
* On the Google Earth output page click the the KML link and save the file to your computer in a location you can find again.
* Please do NOT edit the kml file. My Route expects the file to be as it is generated by GPS Visualizer and any interference with the file may cause the My Route loader to fail. 

User avatar
caughtatwork
Posts: 17013
Joined: 17 May 04 12:11 pm
Location: Melbourne
Contact:

Re: KML import for My Route

Post by caughtatwork » 20 June 16 8:32 pm

OK have a test. Should be working now. If it works for you, please update the wiki.

User avatar
Tardis
3000 or more caches found
3000 or more caches found
Posts: 24
Joined: 04 June 14 11:16 am
Location: Tasmania

Re: KML import for My Route

Post by Tardis » 20 June 16 10:22 pm

Excellent. Works a treat. Routes live another day. Wiki updated accordingly.

Thanks again guys. Top service as always.

Post Reply