Manipulate track lists (track)
Prev | Chapter 4. Data Filters | Next

## Manipulate track lists (track)

WARNING: This filter always drops empty tracks.

This filter performs various operations on track data.

### move option

Correct trackpoint timestamps by a delta.

This option changes the time of all trackpoints. This might be useful if your track must be moved by one or more hours because of an incorrect time zone.

Example 4.8. Time-shifting a track with the track filter

The following command line will shift all tracks to be one hour later.

`gpsbabel -t -i gpx -f in.gpx -x track,move=+1h -o gpx -F out.gpx`

### pack option

Pack all tracks into one.

This option causes all tracks to be appended to one another to form a single track. This option does not work if any two tracks overlap in time; in that case, consider using the `merge` option.

This option is most useful for rejoining tracks that might have been interrupted by an equipment malfunction or an overnight stop.

If no other option is given to the track filter, this option is assumed.

### split option

Split by date or time interval (see README).

The input track will be split into several tracks depending on date of track points. If there is more than one track, use the pack option before before using this. To split a single tracks into separate tracks for each day and name them, use this:

`gpsbabel -t -i gpx -f in.gpx -x track,split,title="ACTIVE LOG # %Y%m%d" -o gpx -F out.gpx`

If the input has multiple tracks, pack them together before splitting them back apart per day thusly:

`gpsbabel -t -i gpx -f in.gpx -x track,pack,split,title="ACTIVE LOG # %D" -o gpx -F out.gpx`

Additionally you can add an interval to the split option. With this the track will be split if the time between two points is greater than this parameter. The interval must be numeric and can be int days, hours, minutes or seconds, expressed as one of the character "d", "h", "m", or "s". If no trailing character is present, the units are assumed to be in seconds.

For example, to split a track based on an four hour interval, use this:

`gpsbabel -t -i gpx -f in.gpx -x track,pack,split=4h,title="LOG # %c" -o gpx -F out.gpx`

### sdistance option

Split by distance.

The input track will be split into several tracks if the distance between successive track points is greater than the distance given as a parameter. The distance must be numeric and can be in miles or kilometers, expressed as one of the character "k", or "m". If sdistance is given no parameters, this option has the same effect as the split option without parameters. If there is more than one track, use the pack option before before using this.

For example, to split the track if the distance between points is greater than 100 meters, use this:

`gpsbabel -t -i gpx -f in.gpx -x track,pack,sdistance=0.1k" -o gpx -F out.gpx`

The sdistance option can be combined with the split option. The track then will be split only if both time and distance interval exceeds the supplied values. This technique can be used to filter out gaps from the tracklog. The gap is kept only if the gps device is without signal for longer time than that given and during that time it moves a distance over that given. This example splits the track if the device is without signal for at least 5 minutes and during this time moves more than 300 meters:

`gpsbabel -t -i gpx -f in.gpx -x track,pack,sdistance=0.3k,split=5m -o gpx -F out.gpx`

### merge option

Merge multiple tracks for the same way.

This option puts all track points from all tracks into a single track and sorts them by time stamp. Points with identical time stamps will be dropped.

Example 4.9. Merging tracks with the track filter

Suppose you want to merge tracks recorded with two different GPS devices at the same time. To do that, use this command line:

`gpsbabel -t -i gpx -f john.gpx -i gpx -f doe.gpx -x track,merge,title="COMBINED LOG" -o gpx -F john_doe.gpx`

### name option

Use only track(s) where title matches given name.

With the name option you can filter out a track by title.

The comparison is always non-case-sensitive. Wildcards are allowed.

### start option

Use only track points after this timestamp.

This option is used along with the `stop` to discard trackpoints that were recorded outside of a specific period of time. This option specifies the beginning of the time period.

If this option is not specified, the time period is assumed to begin at the dawn of time or January 1, 1970, whichever was later. The time for this option is expressed in UTC.

The value of this option must be in the form of YYYYMMDDHHMMSS, but it is not necessary to specify the smaller time units if they are not needed. That is, if you only care about points logged between 10 AM and 6 PM on a given date, you need not specify the minutes or seconds.

Example 4.10. Extracting a period of time with the track filter

To get only the parts of a track that were mapped on 20 July 2005 between 10 AM and 6 PM, use this command line:

`gpsbabel -t -i gpx -f in.gpx -x track,start=2005072010,stop=2005072018 -o gpx -F out.gpx`

### stop option

Use only track points before this timestamp.

This option is used in conjunction with the `start` option to discard all trackpoints outside of a given period of time. This option defines the end of the time period.

If this option is not specified, the time period is assumed to end at the end of civilization as we know it or the year 2038, whichever comes first. The time for this option is expressed in UTC.

See the `start` option for the format of this value and an example of usage.

### title option

Basic title for new track(s).

This option specifies a title for tracks generated by the track filter. By default, the title of the new track is composed of the start time of the track appended to this value.

If this value contains a percent (%) character, it is treated as a format string for the POSIX strftime function, allowing custom time-based track names.

### fix option

Synthesize GPS fixes (PPS, DGPS, 3D, 2D, NONE).

This option sets the GPS fix status for all trackpoints to the specified value. Valid values for this option are PPS, DGPS, 3D, 2D, or NONE.

This option is most useful when converting from a format that doesn't contain GPS fix status to one that requires it.

### course option

Synthesize course.

This option computes (or recomputes) a value for the GPS heading at each trackpoint. This is most useful with trackpoints from formats that don't support heading information or for trackpoints synthesized by the interpolate filter. The heading at each trackpoint is simply the course from the previous trackpoint in the track. The first trackpoint in each track is arbitrarily assigned a heading of 0 degrees.

### speed option

Synthesize speed.

This option computes a value for the GPS speed at each trackpoint. This is most useful with trackpoints from formats that don't support speed information or for trackoints synthesized by the interpolate filter. The speed at each trackpoint is the average speed from the previous trackpoint (distance divided by time). The first trackpoint in each track is assigned a speed of "unknown."

Prev | Up | Next
Manipulate altitudes (height) | Home | Rearrange waypoints by resorting (sort)