Learn R Programming

BayesianAnimalTracker (version 1.2)

DegToKM: Convert between the latitude and longitude in degrees and Northing and Easting in kilometers (KM).

Description

Based on functions from TrackReconstruction, convert the longitude and latitude degrees into easting and northing in kilometer or vice versa.

Usage

DegToKM(gpsformat) KMToDeg(cPath, iniDeg)

Arguments

gpsformat
Output from GPStable, including the latitude, longitude in degrees and between GPS great circle distance and Bearing degree, etc.
cPath
A matrix with two columns, the corrected path from BMAnimalTrack, first column should be easting in KM and second column should be northing in KM.
iniDeg
The longitude and latitude in degree of the starting point of the path

Value

DegToKM returns a data frame with date-time and the converted easting and northing in km. KMToDeg returns a matrix with two columns. The first column is longitude in degree of the corrected path and the second column is the latitude.

Details

Please make sure you organize cPath and iniDeg as the function requires.

References

Liu, Y., Battaile, B. C., Zidek, J. V., and Trites, A. (2014). Bayesian melding of the Dead-Reckoned path and gps measurements for an accurate and high-resolution path of marine mammals. arXiv preprint arXiv: 1411.6683.

See Also

BMAnimalTrack, GPStable

Examples

Run this code
data(Trip1GPS)
GPSformat <- GPStable(Trip1GPS)
GPSinKM <- DegToKM(GPSformat)
#Convert the degree into kilometers.
GPSdeg <- KMToDeg(GPSinKM[, 2:3], GPSformat[1, c(3, 2)])
#Convert the kilometers back into degrees.
#More comprehensive examples can be found by help(Trip1)

Run the code above in your browser using DataLab