interpolate_coords: Coordinates Interpolation

Description Usage Arguments Value Examples

Description

Interpolate GPS coordinates by regularizing the time series for a given increment timeint

Usage

1
interpolate_coords(LatList, LongList, timeseq, timeint = 1)

Arguments

LatList

A vector of size n for latitudes collected from a GPS recording device

LongList

A vector of size n for longitudes collected from a GPS recording device

timeseq

A vector of size n for irregular time sequence of recorded GPS data in format "%Y-%m-%d %H:%M:%S"

timeint

(Optional) Value of desired time step or increment in seconds (default value is 1 second)

Value

interpolate_coords return a table of size n X 3 with columns of ("DateTime","Latitude","Longitude")

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
LatList <- c(31.67514,31.675195,31.67525,
31.675304,31.675356,31.675408,31.675467,
31.675517,31.675569,31.675623)

LongList <- c(-106.326522,-106.326367,
-106.326211,-106.326058,-106.325901,
-106.325739,-106.325572,-106.32541,
-106.325247,-106.325092)

timeseq <- c("2019-04-29 15:20:51",
"2019-04-29 15:21:03","2019-04-29 15:21:06",
"2019-04-29 15:21:15","2019-04-29 15:21:17",
"2019-04-29 15:21:32","2019-04-29 15:21:34",
"2019-04-29 15:21:51","2019-04-29 15:22:09",
"2019-04-29 15:22:36")

timeseq <- as.POSIXct(timeseq)

#regularize time sequence over 1 second
interpolate_coords(LatList,LongList,timeseq,1)

#regularize time sequence over 1 minute
interpolate_coords(LatList,LongList,timeseq,60)

farinoushsharifi/TransGPS documentation built on June 3, 2019, 7:19 a.m.