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

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

Arguments

x

trip object

max.speed

speed in kilometres (or other unit) per hour, the unit is kilometres if the trip is in longitude latitude coordinates, or in the unit of the projection projection (usually metres 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.

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).

Note

This algorithm was originally taken from IDL code by David Watts at the Australian Antarctic Division, and used in various other environments before the development of this version.

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.

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

sda for a fast distance angle filter to combine with speed filtering

Author

David Watts and Michael D. Sumner