Invocation was meant to be flexible. Unfortunately, that can sometimes lead to unwieldy command lines.
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 commands you need to know to do those things:
Command | Meaning |
---|---|
-i format | Set input format |
-f filename | Read file |
-o format | Set output format |
-F filename | Write 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.
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 in GPX format.
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. The second command does the same on Microsoft Windows.
gpsbabel -i magellan -f /dev/ttyS0 -o geo -F mag.loc
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