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.
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.22. 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
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.23. 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 Mapsource. Use the following command:
gpsbabel -i csv -f blah.txt -x transform,rte=wpt -o gdb -F blah.gdb
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.24. 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 Mapsource. Use the following command:
gpsbabel -i csv -f blah.txt -x transform,trk=wpt -o gdb -F blah.gdb
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 "RPTxxx" where xxx 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 usefull if several differently named tracks are contained in the source file which should each be transformed into routes.
Example 4.25. 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
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.26. 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