Interpolate between trackpoints (interpolate)
Prev | Chapter 4. Data Filters | Next

## Interpolate between trackpoints (interpolate)

This filter modifies any tracks so that either the distance or the time between consecutive points is no more than the specified interval. Where points are missing, the filter fills them in by following a straight line (actually a great circle) between the adjacent points. You must specify either the `distance` or the `time` option.

Example 4.5. Using the interpolate filter

This command line reads track.gpx and inserts points wherever two adjacent trackpoints are more than 10 seconds apart:

`gpsbabel -i gpx -f track.gpx -x interpolate,time=10 -o gpx -F newtrack.gpx`

This command reads track.gpx and inserts points wherever two adjacent trackpoints are more than 15 kilometers apart:

`gpsbabel -i gpx -f track.gpx -x interpolate,distance=15k -o gpx -F newtrack.gpx`

This command reads track.gpx and inserts points wherever two adjacent trackpoints are more than 2 miles apart:

`gpsbabel -i gpx -f track.gpx -x interpolate,distance=2m -o gpx -F newtrack.gpx`

### time option

Time interval in seconds.

This option specifies the maximum allowable time interval between adjacent points in the track. If two points in the track are further apart than this value, new points will be inserted between them.

This value is always specified in units of seconds. Examples: 31, 1.5.

Either this option or the `distance` must be specified.

### distance option

Distance interval.

This option specifies the maximum allowable distance between adjacent points in the track. If two points in the track are further apart than this value, new points will be inserted between them.

The units may be specified by appending a suffix to the supplied number:

'm' for meters, e.g. 3500.0m
'ft' or 'feet' for feet, e.g. 11483ft
'k' or 'km' for kilometers, e.g 3.5000km
'nm' for nautical miles, e.g. 1.8898nm
'mi' for miles, e.g. 2.1748mi
'fa' for fathoms, e.g. 1913.82fa

If no units are specified, the units are assumed to be miles.

Either this option or the `time` must be specified.

### route option

Interpolate routes instead.

If this option is specified, the interpolate filter interpolates routes rather than tracks. Because route points do not have time stamps, it is an error to use this option with the `time` option.

Prev | Up | Next
Include Only Points Within Radius (radius) | Home | Manipulate altitudes (height)