Interpolate between trackpoints (interpolate)

This filter modifies any tracks so that either the distance or the time between consecutive points is no less 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 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.

Either this option or the distance must be specified.

distance option

Distance interval in miles or kilometers.

This option specifies the maximum allowable distance between 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 may be specified in units of miles (3M) or kilometers (5K). 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.