Hacking with Geocaching

One of the reasons my wife decided to get me a GPS for my birthday was that geocaching seemed to be something that would appeal to me — because it’s a hobby that I showed some interest in and that it could reach into my geeky side. And Gina didn’t know how right she was . . .

There are lots and lots of formats that can come to and from a GPS but, luckily, GPSBabel understands most of them. And it can transport any format to/from your GPS’s serial connection. Wonderful tool!

I started hacking with the data the comes from Geocaching.com. You can download cache info from the site in LOC format. I thought that it would be nice if I could combine several different LOC files into one and then I could use GPSBabel to transfer at my leisure. Luckily, LOC is an XML format. Thus Hack #1 was born — combineloc.py

Then a friend and fellow cacher sent me his whole cache file. This file was in GPX format. GPX is also an XML-based format and is the most popular. And, naturally, GPSBabel understand GPX as well. GPX is a better format than LOC and so I decided to try to work in GPX as much as possible.

The next problem to tackle now was “How would I keep my found caches separate from my yet-to-be-found caches?” Thus Hack #2 was born — getfoundcaches.py. This will take a GPX file (or data from straight from your GPS via GPSBabel) and save your found caches in a separate file.

Both of these scripts are in Python and try to use just the standard library. But I broke down and used Jason Orendorff’s most-excellent path module. You will need to grab that, too.

Both of these scripts are over at the Garden under the heading “cachehacks”. Read the README for more info or just download the scripts.

Hack #3 is already being worked on, but I will announce that when it is time!

Leave a Reply

You must be logged in to post a comment.