Archive | geocaching

The GPSBabel Fever

Sep 30th, 2005No Comments

I have a GPX file of geocaches that I have found and a load of .loc files from Geocaching.com. What I wanted was to get a non-repeating list of caches that I haven’t found that are in a 2 mile radius of my workplace (for easy lunchtime caching, of course). And I wanted this in HTML. This took me a while to figure out — some of it because I had to get my brain around stacks and others because I made dumb command line mistakes. But this is the final result:

gpsbabel  -i gpx -f found-gpx.xml \  # the GPX of found caches
-x radius,lat=$MYLAT,lon=$MYLON,distance=2m \ # throw out any not by the office
-x stack,push \ # push these onto the stack
-i geo $infiles \  #my input files that I have gathered
-x duplicate,location,shortname \ # take out the duplicates
-x radius,lat=$MYLAT,lon=$MYLON,distance=2m \  # throw out any not by the office
-x stack,pop,append \ # append the found caches by the office onto the list
-x duplicate,location,shortname,all \ # drop all duplicates (i.e. drop all found caches)
-o html -F $cacheout " # finally save them to an HTML file

This is one long command, but does several things. There is a lot of sophisticated things going on there.

Yep — I have the fever.

More Fun with GPSBabel

Sep 29th, 2005No Comments

Robert Lipe, the author of GPSBabel, told me about other tricks:

  • GPSBabel can not only handle many differen types of input files, but those files can be of different type. Example (from the README):
    gpsbabel  -i geo -f 1.loc -i gpx -f 2.gpx -i pcx 3.pcx -o gpsutil -F big.gps
    
  • GPSBabel can also filter out sites based on distance, etc. I cooked this little dandy up last night. It gives me all the points in my GPX backup file that are 3 miles from my house:
    gpsbabel -i gpx -f mine-gpx.xml \\
            -x radius,lat=$HOMELAT,lon=$HOMELONG,distance=3m  \\
           -o gpx -F byhome.xml
    

I won’t say that GPSBabel is easy to figure out — I was lost when I first looked at it — but, wow, it can do a lot.

More on Geocaching Hacks

Sep 28th, 20051 Comment
  • Andy Fowler wrote a PHP script that scrapes Geocaching.com and puts them in a KML format which is used by Google Maps. But Geocaching.com made him take it down! So he put up the script for anyone to hack on.
  • Robert Lipe, the author of GPSBabelwrote me and said that his tools could combine formats as well as convert them:
    gpsbabel -i geo -f 1.loc -f 2.loc -f 3.loc -o geo -F combined.loc
    

    Well, combineloc.py maybe now out of a job

Hacking with Geocaching

Sep 26th, 2005No Comments

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!

Geocaching

Sep 19th, 20051 Comment

You can probably see some strange de.lirio.us links on the left. All of them are under a new tag — “geocache“.

Yes, it’s a new hobby that I have started — thanks to my wife, who got me a GPS for my birthday! Thanks, Gina! It’s a pretty cool device and it has many other uses than just geocaching — I’ll blog more about them later.

I was excited to try it out so I found what seemed to be the easiest cache by my house and I did find it. It was trickier than I thought and I will have to get used to how my GPS acts when I get close to the mark. But it was great fun and I’m anxious to go again.

Since Geocaching.com doesn’t let you use their internal bookmarking unless you pay money, I’m using de.lirio.us.

Page 5 of 5«12345