
2
Chapter 2. Usage
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:
Command: -i format
Meaning: Set input format
Command: -f filename
Meaning: Read file
Command: -o format
Meaning: Set output format
Command: -F filename
Meaning: Write output File
The format parameters in the above list refer to the names of formats or file types supported by GPS-
Babel.
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
Kommentare zu diesen Handbüchern