Transform waypoints into a route, tracks into routes, ... (transform)

This filter can be used to convert GPS data between different data types.

Some GPS data formats support only some subset of waypoints, tracks, and routes. The transform filter allows you to convert between these types. For example, it can be used to convert a pile of waypoints (such as those from a CSV file) into a track or vice versa.

The following example show you how to create a route from a waypoint table.

gpsbabel -i csv -f waypts.txt -x transform,rte=wpt -o gpx -F route.gpx

Only the first letter of option value decides which transformation will be done. Depending on the used option it can be only 'W' for waypoints, 'R' for routes or 'T' for tracks.

wpt option

Transform track(s) or route(s) into waypoint(s) [R/T].

This option selects the destination type of this filter to be waypoints. Choose this when you want to convert tracks or routes into waypoints.

Example 4.27. Converting a track to a sequence of waypoints

Say you you have a KML file that contains a track but you want to convert it to a CSV file that can contain only waypoints, perhaps to import into a spreadsheet. Use the following command:

gpsbabel -i kml -f blah.kml -x transform,wpt=trk -o csv -F blah.txt


rte option

Transform waypoint(s) or track(s) into route(s) [W/T].

This option selects the destination type of this filter to be routes. Choose this when you want to convert tracks into waypoints routes. A single route will be created in the sequence they appear in the input.

Example 4.28. Converting a pile of waypoints to a GPX route

Say you you have a data file that came from CSV file that you want to convert to a GPX route that can be loaded into Basecamp. Use the following command:

gpsbabel -i csv -f blah.txt -x transform,rte=wpt -o gdb -F blah.gdb


trk option

Transform waypoint(s) or route(s) into tracks(s) [W/R].

This option selects the destination type of this filter to be tracks. Choose this when you want to create tracks from a list of waypoints or routes. A single track will be created in the sequence they appear in the input.

Example 4.29. Converting a pile of waypoints to a GPX track

Say you you have a data file that came from CSV file that you want to convert to a GPX track that can be loaded into Basecamp. Use the following command:

gpsbabel -i csv -f blah.txt -x transform,trk=wpt -o gdb -F blah.gdb


rptdigits option

Number of digits in generated names.

This option lets you configure how many digits GPSBabel uses for numbering generated route point names.

When GPSBabel creates route points during the transformation process these points are sequentially numbered and named "RPTnnn" where nnn represent the number. By default GPSBabel uses 3 digits for these numbers. Rationale: This way a large number of route points can be uniquely named while the generated names are limited to 6 characters. This limitation is imposed by specific GPS-devices.

Using this option GPSBabel can be configured to use less or more digits for the generated names. This option is best used in conjunction with the rptname option.

Example 4.30. Convert a GPX track to a GPX route, deleting the original track, using 2 digits for the generated numbers.

gpsbabel -i gpx -f track.gpx -x transform,wpt=trk,del,rptdigits=2 -o gpx -F route.gpx


rptname option

Use source name for route point names.

With this option you can decide to let GPSBabel name generated route points according to their source track name.

GPSBabel creates route points during the transformation process named "RPTnnn" where nnn is a numeric part.

Using this option GPSBabel can be configured to replace the "RPT" part of the generated names by the name of the source track during the transformation process. This is especially useful if several differently named tracks are contained in the source file which should each be transformed into routes.

Example 4.31. Convert a GPX track to a GPX route, deleting the original track, naming the generated points like the original track name.

gpsbabel -i gpx -f track.gpx -x transform,wpt=trk,del,rptname=y -o gpx -F route.gpx


del option

Delete source data after transformation.

This option, when used in connection with the wpt, rte, or trk options, tells GPSBabel to delete the source data after conversion. This is most useful if you are trying to avoid duplicated data in the output.

Example 4.32. Convert a GPX track to GPX waypoints, tossing the original track

gpsbabel -i gpx -f blah.gpx -x transform,wpt=trk,del -o gpx -F converted.gpx


timeless option

Create transformed points without times.

This option tells GPSBabel to create points without creation times instead of copying the creation time from the source points.