Learn R Programming

trip (version 1.5.0)

speedfilter: Filter track data for speed

Description

Create a filter of a track for "bad" points implying a speed of motion that is unrealistic.

Usage

speedfilter(x, max.speed = NULL, test = FALSE)

Arguments

x

trip object

max.speed

speed in kilometres per hour

test

cut the algorithm short and just return first pass

Value

Logical vector matching positions in the coordinate records that pass the filter.

Warning

This algorithm is destructive, and provides little information about location uncertainty. It is provided because it's commonly used and provides an illustrative benchmark for further work.

It is possible for the filter to become stuck in an infinite loop, depending on the function passed to the filter. Several minutes is probably too long for hundreds of points, test on smaller sections if unsure.

Details

Using an algorithm (McConnnell et al., 1992), points are tested for speed between previous / next and 2nd previous / next points. Contiguous sections with an root mean square speed above a given maximum have their highest rms point removed, then rms is recalculated, until all points are below the maximum. By default an (internal) root mean square function is used, this can be specified by the user.

If the coordinates of the trip data are not projected, or NA the distance calculation assumes longlat and kilometres (great circle). For projected coordinates the speed must match the units of the coordinate system. (The PROJ.4 argument "units=km" is suggested).

References

The algorithm comes from McConnell, B. J. and Chambers, C. and Fedak, M. A. (1992) Foraging ecology of southern elephant seals in relation to the bathymetry and productivity of the southern ocean. Antarctic Science 4 393-398

See Also

trip