Making GPX Tracks

From OpenStreetMap

Jump to: navigation, search

Contents

OpenStreetMap and related free map projects uses GPS Exchange Format (GPX) for uploading and publishing trackpoints. Most GPS units have their own data format.

GPSBabel is a handy tool that can convert the various data formats to the desired GPX format.

GPSBabel is available for Macintosh, Windows, and *nix at www.gpsbabel.org. There are binary packages for Windows and Mac OSX. For Windows and OSX download the package and uncompress the files. Under Linux download the source package, uncompress it, and type 'make.' On Debian, apt-get install gpsbabel. On Fedora, yum install gpsbabel.

Exchanging Waypoints and Tracklogs with a GPS

GPSBabel directly supports Garmin, Magellan and Wintec GPS units. Connect your GPS to your serial cable, if you lack a serial port see GPS Serial to USB. A Garmin serial GPS is specified -i garmin while a Magellan is -i magellan. Use the -f and -F parameters to specify the serial port for your GPS. Use -f when you read from the GPS and -F to write to the GPS. (NB, if the following commands do not appear to work on the Garmin units, check that the Interface Setting on the unit is set to "GARMIN" or "GARMIN DGPS").

You can get more information by running gpsbabel -?, and by reading the README file. Here are some examples:

To read waypoints from a Garmin GPS and write them out to the GPX format file named 'waypoint.gpx.'

Windows

Under Windows assume the GPS is attatched to the first serial port:

gpsbabel -i garmin -f com1 -o gpx -F waypoint.gpx

That sets the input type to the Garmin serial protocol to read data from the serial port and write it to a GPX format file named waypoint.gpx.

If instead the device is connected to the USB port:

gpsbabel -i garmin -f usb: -o gpx -F waypoint.gpx

Linux

Under Linux assume the gps is attatched to the first serial port (need to run as a user who has rights to read the serial port, so probably run as root or with sudo)

gpsbabel -i garmin -f /dev/ttyS0 -o gpx -F waypoint.gpx

If the device is connected to the USB port

gpsbabel -i garmin -f /dev/ttyUSB0 -o gpx -F waypoint.gpx

See also: http://www.gpsbabel.org/os/Linux_Hotplug.html

If you have problems accessing the USB0 port on your Ubuntu Linux, you might want to read this discussion thread on Ubuntu Forums and remove the packages brltty and brltty-x11 (Braille support apparently breaks USB serial).

Mac OSX

Under OSX assume the GPS is attatched to a serial to USB adapter

gpsbabel -i garmin -f /dev/cu.usbserial0 -o gpx -F waypoint.gpx

Track logs

To read track logs you add a '-t' in front of the input (-i) specifier. So to get tracklogs under Windows:

gpsbabel -t -i garmin -f com1 -o gpx -F tracklog.gpx

Routes

And in the same way, you can read or write routes with the -r parameter:

gpsbabel -r -i garmin -f com1 -o gpx -F route.gpx

Writing to a Garmin unit

You can also write tracklogs, waypoints, and routes back to your gps by swapping the input and output parameters. To write waypoints from waypoint.gpx to a Garmin unit under Windows:

gpsbabel -i gpx -f waypoint.gpx -o garmin -F com1

GPSBabel GUI

GPSBabel GUI for Windows
GPSBabel GUI for Windows

Since GPSBabel 1.3.0, a GUI for GPSBabel is included in the Windows and OSX distributions. Screenshots

These versions support the advanced filtering unavailable in some of the third party GUI wrappers.

Third Party

There are graphical wrappers for GPSBabel for many platforms.

  • Under Windows run
    • gpsbabelfront.
    • or GPSBabelWrapper. Available free from Quakemap (Quakemap is not required for it to work. If not installed you can ignore the error message when starting). Requires .NET Framework.
  • Under Mac OSX run GPSBabel+.
  • Under Linux run guibabel. You must ensure that the gpsbabel program is in your path before starting guibabel.
  • Under Windows, or Mac OS X, or Linux, run gebabbel.

In this screen shot we see the Windows version of GPSBabel set up to read Waypoints from a Garmin GPS via the serial port, Com1, and save them to the GPX format file named 'waypoint.gpx.'

Much of the power of GPSBabel is masked by the graphical user interfaces! Only the Mac OSX GUI allows access to the Filter commands, and even it does not support the newer filter options.

!! Using GPS Babel from the command line

As with many powerful tools, the command line is where much of the interesting functionality lives. The tradeoff is a small learning curve. The basic command line looks like this:

gpsbabel [options] -i INTYPE -f INFILE -o OUTTYPE -F OUTFILE

Where ‘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. Like '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

To convert these to the GPX format file way.gpx:

gpsbabel -i csv -f way.csv -o gpx -F way.gpx

Deconstructing the command line: '-i csv' using the comma separated value INTYPE. '-f way.csv' (note that is lower case) specifies the name of the input file (or the name of the input serial port). '-o gpx' specifies the output is a GPX file. '-F way.gpx' (capital F) provides the name of the output file (or output serial port).

Using Gpsbabel Filters

See Editing GPX Tracks for information on using Gpsbable filters to edit your track.

Other software - Mac OS X

GPSies.com, online converter and route portal, converts also Garmin TCX / CRS files to GPX. Submission to OpenStreetMap possible.

MacSimpleGPS, though still in beta, provides a simple GUIfied way to download tracks from your GPS unit as GPX files.

GPSBabel+ has a GUI that's much less limited than the Windows or TCL ones described above.

JOSM accept several input formats (OSM-xml, GPX and CSV) and has a GPX export function.

LoadMyTracks support for Garmin (USB and serial), lowrance, magellan (USB and Serial), and others - download and upload of tracks, waypoints, routes and laps - GPX or KML export (works nicely with my Garmin GPSMAP 60CSx)

RubiTrack Support direct import from Garmin (including TCX). Also has embedded gpsBabel for other formats. Can export GPX. Currently don't use OSM as source of maps (just Google), but developers say, that OSM will be later.

Online conversion

Series 60 Software (for Bluetooth GPS's)

  • GETrack logs your location at a variety of intervals, to be sent to your computer by Bluetooth. Exports the data in a number of formats, including GPX (as of v1.50) and will cost you $13.99.
  • AFTrack creates tracks, shows speed, altitude etc, etc. Exports in a number of formats. It costs $22.00
  • nmea_info.py shows where you are, what satellites you can see, and optionally also logs your location (at a user configurable frequency). Log files are in NMEA format, but you can use upload_track.py to upload them over bluetooth as GPX.
  • simple_nmea.py is a simple nmea python script.
  • SportsTracker is a free application for S60 3rd edition Nokia phones. Tracks can be exported in GPX format. Works with internal GPS receivers (if your phone has one) and with external Bluetooth GPS receivers
  • WhereAmI is a free application for smartphones with S80, S60 or UIQ3 system. Shows data from OSM while Tracking. Tracks cann be annotated and exported in GPX format. Work with internalor external GPS receivers. Hompage of WhereAmI

iPhone Software

See discussion on forum,

  • Track'n Trail supports OSM upload of GPS traces, no extra steps needed. To me it's the best tracking application for iPhone with a nice track view and UI, and can record multiple tracks.
  • Path Tracker Very cheap app that can export into GPX. Not able to record multiple tracks though.
  • GPS Kit Also quite nice. Can show you lots of data like speeds and distances.
  • TrackMe Can record multiple tracks and export to GPX. Looks incomplete though.
Personal tools
recent changes