interpolateTime: Interpolate a trajectory

Description Usage Arguments Details Value Author(s) Examples

Description

This function allows to interpolate trajectories. It does this on the basis of a simple interpolation, depending on the spaceMethod that is specified.

Usage

1
interpolateTime(x, time, spaceMethod=c('euclidean','greatcircle','rhumbline'),...)

Arguments

x

a move or moveBurst object

time

either a number of locations (class numeric), a time interval (class difftime) or a vector of timestamps (class POSIXct) at which the interpolation should be done. See 'Details'.

spaceMethod

a character that indicates the interpolation function to be used

...

Currently not implemented

Details

In the argument time:
- number of locations: refer the total number of locations that the resulting track will have distributed equally over time. E.g. if time=200, the resulting track will have 200 points interpolated at a constant time interval.
- time interval: refers to the time interval at which a location should be interpolated. E.g. if time=as.difftime(10, units="mins") a location will be interpolated every 10 mins.
- vector of timestamps: the timestamps of this vector have to be in ascending order, and within the time range of the track.

Value

Move-class object of the interpolated locations.

Author(s)

Bart Kranstauber & Anne Scharf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data(leroy)
## providing the number of locations
plot(leroy[100:150,], col="red",pch=20)
points(mv <- interpolateTime(leroy[100:150,], time=500, spaceMethod='greatcircle'))

## providing a time interval
plot(leroy[100:150,], col="red",pch=20)
points(mv2 <- interpolateTime(leroy[100:150,], time=as.difftime(10, units="mins"), 
                              spaceMethod='greatcircle'))

## providing a vector of timestamps
plot(leroy[100:150,], col="red",pch=20)
ts <- as.POSIXct(c("2009-02-13 10:00:00", "2009-02-13 12:00:00", "2009-02-13 14:00:00",
                   "2009-02-13 16:00:00","2009-02-13 18:00:00","2009-02-13 20:00:00",
                   "2009-02-13 22:00:00","2009-02-14 00:00:00","2009-02-14 02:00:00",
                   "2009-02-14 04:00:00","2009-02-14 06:00:00", "2009-02-14 08:00:00", 
                   "2009-02-14 10:00:00"),  format="%Y-%m-%d %H:%M:%S", tz="UTC")
points(mv3 <- interpolateTime(leroy[100:150,], time=ts, spaceMethod='greatcircle'))

move documentation built on Aug. 24, 2017, 1:04 a.m.