The GPSBabel Fever
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.