Paper Chase


Digital GPS-aided treasure hunts, or geocaching, is becoming more popular. We investigate the choice of geocaching software available for Linux.

By Sebastian David

Geocaching is often referred to as the paper chase of the digital age. In May 2000, Dave Ulmer published the first geocache on the sci.geo.satellite-nav mailing list. In his posting [1] he describes a fairly simple idea: geocachers would download the coordinates for a location off the Internet and then use a GPS device to locate the place. Once there, they would look for a hidden container with a logbook and possibly other goodies. The Geocacher could then create an entry for the find with a name and date.

The "treasure" hidden by Dave Ulmer - this is how people typically refer to the containers - was found for the first time within 24 hours, and more caches followed. The first website with a collection of coordinates at which you could find geocaches went online shortly after this. A copy of this platform has been preserved [2]. An enormous community arose from these modest beginnings.

Modern Variants

Although the basic principle remains the same, variations on the theme have now developed. In fact, 10 cache types range from Traditional, in which you find the hidden container at the location specified in the coordinates, to multi-cache, in which you set off from a start location and need to locate various stations to find the final hiding place, to mystery, in which you first need to solve a puzzle to get your hands on the GPS data.

The size of the treasure can also vary. For example, nanos are typically as big as a nail head, whereas micro are traditionally film canister. One of geocaching's particular attractions is keeping the treasures as well hidden as possible from passers by - known as muggles by geocachers - and finding and rehiding treasures. As of this writing, more than 1 million geocaches exist worldwide.

The most important sites for finding the coordinates are Geocaching.com and Navicache.com. These platforms require you to register free of charge to access data and offer geocache listings besides the coordinates.

First Steps in Geocaching

For your initial steps, all you need is a computer with an Internet connection. To find your first geocaches, use the published coordinates and various digital online maps, such as Google Maps [3] or OpenStreetMap [4]. In fact, this is how I logged my first finds. Having said this, you will quickly exhaust the possibilities of this method.

A digital paper chase is far easier if you have a GPS receiver. Two vendors have cornered the market for amateur treasure hunters: Garmin [5] and Magellan [6] (see also the "GPS Receivers and Linux" box). These two vendors are still competing to modify their devices to match the geocacher's requirements better than ever. For example, they offer GPS receiver with preset geocaching profiles (Figure 1). Once you have found the right equipment and your first caches, you will soon start looking for a software tool that helps you manage caches in a database, facilitates route planning, and lets you keep statistics for your own finds. The most important requirement for a program is that it has to be able to download and manage the data from preset geocaching websites.

Figure 1: GPS receivers in the Garmin Oregon series support geocaching.
GPS Receivers and Linux

If you happen to own a Magellan device, you have no alternative but to use Windows, or a Windows emulator, for firmware updates. This is not true of Garmin: The vendor website offers the latest software version. Just download the software, rename it gupdate.gcd if needed, and copy it to the /GARMIN directory on your receiver. Then disconnect your GPS receiver from your computer and restart - everything else is fully automated.

Of course, the GPS receiver vendors all try to sell their own maps, but if you prefer to use free maps, the OpenStreetMap project has a great selection. One benefit offered by the OpenStreetMap data is that it is updated on a daily basis: The servers process the information provided by users every day. The disadvantage is that areas outside of cities are typically not fully covered.

Users with Garmin equipment can access the free map material directly, but it is not quite as easy if you have a Magellan receiver. To convert the free maps into a format supported by your device, you need the Pymag [7] tool.

Geocaching Software

The most popular geocaching program is GSAK - the acronym stands for the not entirely humble Geocaching Swiss Army Knife [8]. The proprietary Windows software is available for downloading free of charge, but it asks you to register for a price after 21 days. If you want to run GSAK on Linux, you can do so in a Wine environment. A very useful how-to for this process is available [9]. One of GSAK's biggest advantages is its modular structure: Macros let users modify the functional scope to suit their own needs and add extensions.

If you prefer to use free software, Viking [10] is a nice alternative (Figure 2). This GPL program is written in C with the Gtk+ 2 toolkit. The latest version, 0.9.93, is available for various Linux/Unix/BSD distros and Windows. Maps can be imported from TerraServer or OpenStreetMap, with separate layers for GPS data and other information. With Viking, you can import and draw tracks and waypoints, add coordinate lines, make new tracks and waypoints, and export GPX data.

Figure 2: Viking puts information from different sources into separate layers.

Data Transfer

The all-rounder among the programs for editing, converting, and transferring individual geocaching formats between servers on the Internet and your GPS receiver is the aptly named GPSBabel [11]. You will find it in the repository of any major distribution. GPX, an XML-based format, has established itself as the format of choice for exchanging geodetic data, which is why the geocaching websites offer their cache listings in the form of GPX files.

One special service that Geocaching.com offers is pocket queries, or PQs for short. These GPX files can contain up to 500 cache descriptions. When you submit a query, you need to define a geographical center, a certain radius around it, and possibly a time period during which the caches were hidden. The server then references this data to create the PQ.

The number of caches in a PQ is limited to 500. If you want to use pocket queries to find out about caches hidden in a large area, it is a good idea to define multiple queries for different timeslots. A query of this kind will return multiple GPX format files. To then merge, say, four files to create a single file, you need GPSBabel: At the command line, issue

$ gpsbabel -i gpx -f file1.gpx file2.gpx file3.gpx file4.gpx -o gpx -F <i>Ort<i>.gpx

to merge the individual records in a file. Then, you can transfer the file to your GPS receiver as follows:

gpsbabel -i gpx -f <i>Ort<i>.gpx -o <i>device_manufacturer<i>
         -F /dev/tts1

The device name to use here (/dev/tts1 in this example) depends on the port to which you connected your GPS receiver.

Various Internet sites let you press a Send to GPS button to send the data for the currently selected caches to your receiver. However, this will only work with some device-specific extensions that the vendors only provide for the Windows operating system. The Firefox Send2GPS [12] plugin resolves this issue, but has a dependency on GPSBabel.

A Question of Formats

When you load a GPX file on your GPS receiver, the listings are displayed in a certain, platform-specific way. This always starts with a cache number, with a format that depends on the provider; for example, Geocaching.com numbers start with GC.

Some GPS receivers restrict the length of the display name to a certain number of characters. The classic approach is for the receiver to display only the name or number of a geocache. In the real world, it makes more sense to add more information to this data, such as the cache type or the container size. This means that if you are on a longer trek, you can decide at a glance whether or not to go for the cache.

Instead of modifying GPX files painstakingly in an editor, you can use GPX Tools [13]. This GPL'd collection of tools gives you a number of options for automating GPX file manipulation. In particular, Gpxrewrite is a powerful tool for modifying data to reflect your own needs. To launch the command-line tool, enter:

$ gpxrewrite settingfile.ini <i>input<i>.gpx <i>output<i>.gpx

The settingfile.ini entry lets you make changes. Listing 1 is an example of a settings file that converts the less informative GC1JF79 Data Vice into a more intuitive US[4|1.5] Data Vice. The cache type is a mystery cache ("Unknown," U). The size of the container is small (S). The difficulty level is 4, and the terrain difficulty is 1.5.

If the device you use is restricted with respect to the number of characters it can display, it makes sense to minimize the data to the cache number, cache type, and container size when you convert the data. In settingfile.ini, you could specify Desc_Format=%C%s%i to do this. In the previous example, GC1JF79 would then become US1JF79.

Listing 1: settingfile.ini
01 # settingfile.ini (example)
02 # Definition of characters for
03 # the variable %C (cache type)
04 Benchmark_Prefix=X
05 CITO_Event_Prefix=C
06 Earthcache_Prefix=G
07 Event_Prefix=E
08 Letterbox_Hybrid_Prefix=B
09 Locationless_Prefix=L
10 Mega_Prefix=E
11 Multi_Prefix=Mu
12 Project_APE_Prefix=A
13 Traditional_Prefix=Tr
14 Unknown_Prefix=U
15 Virtual_Prefix=V
16 Webcam_Prefix=W
17 # Desc_Format returns cache type,
18 # cache size, difficulty,
19 # terrain difficulty and
20 # cache of names
21 Desc_Format=%C%s[%D|%T] %N

Conclusions

Trying to cope with the geocaching paper chase presents Linux users with a number of obstacles because most GPS vendors and the operators of popular geocaching websites almost exclusively cater to Windows. However, with some prior knowledge and the right programs, nothing can stop you from enjoying the geocaching adventure on Linux.

INFO
[1] Dave Ulmer: http://geocaching.gpsgames.org/history/announcement.txt
[2] The first geocaching homepage: http://web.archive.org/web/20000621194709/ http://www.triax.com/yngwie/gps.html
[3] Google Maps: http://maps.google.com/
[4] OpenStreetMap: http://www.openstreetmap.org/
[5] Garmin: http://www.garmin.com/
[6] Magellan: http://www.magellangps.com
[7] Pymag: http://sourceforge.net/projects/pymag/
[8] GSAK homepage: http://gsak.net
[9] GSAK how-to: http://gsak.net/board/index.php?showtopic=2081&st=0&#entry1247
[10] Viking: http://sourceforge.net/apps/mediawiki/viking/
[11] GPSBabel: http://www.gpsbabel.org
[12] Send2GPS for Firefox: http://wiki.mopage.de/index.php?n=Main.Firefox
[13] GPX Tools: http://rumkin.com/software/gpx_tools/
THE AUTHOR

In his day job, Sebastian David is responsible for developing spices. He spends most of his leisure time outdoors geocaching with his kids and enjoying the environment.