The “Whereabouts” Python script is a helper tool to handle geolocated data more easily. Practically all conversions of GPS-related data can be done with GPSBabel, but it has too much options, and I grew tired of figuring out how to achieve what I wanted it to do. Besides, I like the output of GPS Visualizer, and GPSBabel just adds too much information. After playing with the options for a while, I found a set of option that produced something pretty close to what I wanted, and I took it from there.
When developing “Whereabouts”, I hade the following use scenarios in mind:
Take a track from my Garmin handheld GPS device, and translate it into something Google Earth will read. Note that my GPS device already creates a track log in gpx format, straight on the µ-SD card. I prefer to transfer this file, rather than read the track-log from the device.
This mode will reate a single track, that is: separate parts of the file will be glued together, to compensate for loss of reception or the tea-break.
Take one or more tracks from the dutch “Fietsrouteplanner” (bicycle route builder) in gpx format, and turn it into a Google Earth file.
In this mode, the script will produce a single file with multiple tracks in it.
Take a file from Google Earth, and create a gpx file with multiple tracks, but with each track containing no more than n points, with n=500 for my device.
Transfer a track to my Garmin GPS device.
Macintosh users may find the droplets that are listed below useful to perform these tasks without having to use the command-line.
Google Earth has no method of calculating the length of a track, at least not easily. There are some web tools available to claculate this length, but it should be classified as a missing feature. Since my tool is rewriting the output kml file from GPSBabel anyway, it was not very hard to calculate the total length of the tracks and add that information to the description of the track. It actually became trivial after I found some code by Chris Veness to do the calculation. All I had to do was translate from JavaScript into Python. Since I’m a metric kind of guy, you'll get the length in kilometres.
A second feature has to do with processing kml to kml. Since I can add useful information to a track, it makes sense to process kml to kml, for instance to combine several files, or just to add lengths. However, processing by GPSBabel will strip out the descriptions you might have added to the tracks. My script will try to transfer kml commands to the output kml file.
For symmetry reasons in the code, you can use any combination of kml, kmz, gdb and gpx input files, and produce gpx, kml or kmz from them. MapSource files (gdb) can be produced, but this is not recommended. Because most kml files will come compressed into kmz files, support for this is added to the script, a plain GPSBabel will not handle these files.
You’ll need to have the following software installed to use the script:
The basic translation is done through GPSBabel. On Mac OS X and Linux/Unix the $PATH environment variable will be searched to find gpsbabel, so if you can use it from the command-line, Whereabouts will find it. I suggest you it install in /usr/local/bin. On Microsoft Windows you will need to supply the full path to the script. I have never tested the script on Windows, so let know how that works out.
The droplets for use with Mac OS X include GPSBabel, so there is no need to install this separately, the applications are ready for use out of the box.
Place the “Whereabouts.py” script somewhere in your path. Oh, the full package is available from my website.
The tool has the following command line options:
You can put as many gpx, kml, kmz and gdb files on the command line as you want.
In the package five ready to use droplets are included for use with Mac OS X. These contain the gpsbabel binary, and the Whereabouts python script, so there is no need to install anything else. Drop the files you want to work with onto the applications, and the desired conversion takes place. The five droplets perform the four numbered actions listed in the introduction.
The droplets were made with Platypus, the shell scripts are included in the distrobution package.
Whereabouts GPS handling tool
Copyright © 2008 Maarten Sneep
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public Licence as published by the Free Software Foundation; either version 2 of the Licence, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public Licence for more details.
You should have received a copy of the GNU General Public Licence along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
The GNU General Public Licence can be found on the website of the Free Software Foundation. A copy is included in the full Whereabouts package.
Send comments, bug fixes and suggestions to .