GPStable {TrackReconstruction} | R Documentation |
Format GPS data
Description
Takes DateTime, Latitude and Longitude in decimal degrees and converts Latitude and Longitude into radians and calculates bearing and distance between consecutive locations
Usage
GPStable(rawdata)
Arguments
rawdata |
data frame with DateTime, or Date and Time separately, in same format as deadreckoning data, Latitude and Longitude in decimal degrees. Must use those column labels. |
Details
Data must be provided in decimal degrees (e.g. 162.546). Longitude values west of the prime meridian are 0 to -180.
Latitude values south of the equator are 0 to -90. DateTime must be in the same format as output of DeadReckoning
function or separated as Date and Time that can be pasted together to create the same format as output of the Deadreckoning
function. Distance is calculated using the Spherical Law of Cosines (see references).
Value
Returns a data frame with columns DateTime, Latitude(Decimal Degrees), Longitude(Decimal Degrees), LatRad(Radians), LongRad(Radians), BearingRad, BearingDeg, DistanceKm. BearingRad and BearingDeg are the bearing calculated from point x to point x+1. DistanceKm is the distance between point x and point x-1.
Author(s)
Brian Battaile
References
https://www.movable-type.co.uk/scripts/latlong.html
Examples
data(gpsdata02)
head(gpsdata02)
gpsformat<-GPStable(gpsdata02)
head(gpsformat)