
Speak in Geotongues: GPSBabel to the Rescue #51
Chapter 5, Mapping with Gadgets
|
223
HACK
Much of the power of GPSBabel is masked by the graphical user interfaces,
however. As an example, only the Mac OS X GUI allows access to the Filter
commands, and even it does not support the newer filter options.
Using GPSBabel from the Command Line
As with many powerful tools, the command line is where the interesting
functionality lives. The trade-off is a small learning curve. The basic GPSBa-
bel command looks like this:
gpsbabel [options] -i INTYPE -f INFILE -o OUTTYPE -F OUTFILE
INTYPE and OUTTYPE are formats that GPSBabel understands, and INFILE and
OUTFILE are the locations of that data. That location can be either a file or
the name of a physical device, such as com1 under Windows or /dev/ttyS0
under Linux.
Let’s say you have latitude, longitude, and waypoint name in the file way.csv:
40.70175, -103.68998, First Waypoint
39.28553, -123.79357, Another point
42.49638, -108.72995, And a third
Use this command to convert this file to the GPX-format file way.gpx:
$ gpsbabel -i csv -f way.csv -o gpx -F way.gpx
Deconstructing the command line, -i csv indicates that the input file uses
comma-separated values;
-f way.csv (note that this is lowercase) specifies
Figure 5-4. GUI wrapper for GPSBabel, gpsbabelfront, under Microsoft Windows