Off-line caching along a route
I recently did a European cycle trip and wanted the opportunity to collect a few geocaches along the way. This post and the next one on translation, describe the tools I used to wrangle the data from geocaching.com in to a GPX file and attempt to translate the cache descriptions and logs into English.
First the tools I use for geocaaching:
I use an android phone (rooted with cyanogenmod, but these tools all work on an unrooted phone) for geocaching. When I wanted something more suitable for geocaching than my old Garmin Etrex I looked at Garmin and other dedicated GPS, but decided a phone was more flexible and one third the price. My Motorola Defy+ is reasonably robust, and supposedly waterproof (not tested (yet!) although I use it happily in the rain). The GPS appears more accurate and works better than the Etrex when signals are weak (inside buildings) but can take along time to get a fix without access to the AGPS data via wifi.
Locus Pro can import caches stored in GPX format files.
Below I describe how I created a GPX file of the caches I expected to cycle past on my trip.
The first step is to get a KML file of the the cycle trip route.
Using Google maps to get a KML file of the route
The ways to save directions from Google maps and export them to a KML seems to vary and change depending on exactly which interface to Google maps you are using. The following worked on 2014-11-09.
- go to https://mapsengine.google.com/map/
- create a new map
- select the icon for add directions
- enter the start and end points for your cycle trip, and change the mode to cycle.
- click on the folder icon near the top left, and select export to KML
- select directions and download the file.
- this file is a KMZ file which is just a zipped up KML file, extract the KML file using an appropriate archive tool
Convert the KML file to a GPX file
- Either use an on-line tool such as kml2gpx or gpsvisualizer
- Or use GPSBabel http://www.gpsbabel.org/.
An alternative using the ordinary Google maps interface and gpsbabel is described here.
openrouteservice.org allows you to save a route directly as a GPX file, but only works for places in Europe.
Get the caches along the route in the GPX file
- Install geotoad and follow these instructions
- Copy the geotoad instruction output by the script, add your own login name and password for geocaching.com, save this new command as a bash file, make executable and run.
- The output of this last step should be a GPX file that can be importing into your caching software. It should contain all the caches within the specified distance of your cycle route.
See this next blog post if you want to translate the cache descriptions and logs into English (or another language).
Note: Use geotoad at your own discretion it may not be strictly compatible with the terms of service of geocaching.com.