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

1
2
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

Details

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

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.

Author(s)

Yang (Seagle) Liu <yang.liu@stat.ubc.ca>

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

1
2
3
4
5
6
7
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)