Invocation

If you're using GPSBabel, you will need to know how to do at least two things: read data from a file, and write it to another file. There are four basic options you need to know to do those things:

CommandMeaning
-i formatSet input format
-f filenameRead file
-o formatSet output format
-F filenameWrite output File

The format parameters in the above list refer to the names of formats or file types supported by GPSBabel.

gpsbabel -?

will always show you the supported file types. In this document, the various supported formats are listed in Chapter 3, The Formats. The name that you would use on the command line follows the format name in parentheses.

Options are always processed in order from left to right. In practical terms, this means that things you want to read should appear in the command before things you want to write.

The filename parameters specify the name of a file to be read or written.

To use this program, just tell it what you're reading, where to read it from, what you're writing, and what to write it to. For example:

gpsbabel -i geo -f /tmp/geocaching.loc -o gpx -F /tmp/geocaching.gpx

tells it to read the file /tmp/geocaching.loc in geocaching.com format and create a new file /tmp/geocaching.gpx in GPX format. It's important to note that the names have nothign to do with the formats actually used.

This command will read from a Magellan unit attached to the first serial port on a Linux system (device names will vary on other OSes) and write them as a geocaching loc file.

gpsbabel -i magellan -f /dev/ttyS0 -o geo -F mag.loc

This second command does the same on Microsoft Windows.

gpsbabel -i magellan -f com1 -o geo -F mag.loc

Optionally, you may specify -s in any command line. This causes the program to ignore any "short" names that may be present in the source data format and synthesize one from the long name. This is particularly useful if you're writing to a target format that isn't the lowest common denominator but the source data was written for the lowest common denominator. I use this for writing data from geocaching.com to my Magellan so my waypoints have "real" names instead of the 'GC1234' ones that are optimized for NMEA-only receivers. A geocacher with a Magellan receiver may thus find commands like this useful.

gpsbabel -s -i geo -f geocaching.loc -o magellan -F /dev/ttyS0

gpsbabel -s -i geo -f geocaching.loc -o magellan -F com1