View source: R/camera trap package E.r
geo2proj | R Documentation |
This function converts longitude & latitude from geographic to projected coordinate system. Users can specify their coordinate reference systems, or leave them as default. The default setting will using "WGS83" as geographic coordinates system and "UTM" as the projection coordinates system. The "zone" for UTM projection system will be determined using the centriod of points (longitude & latitude).
geo2proj(data, geo = NULL, proj = NULL)
data |
data.frame with column names "Lon" & "Lat" |
geo |
geographic coordinate system, e.g. "+proj=longlat +datum=WGS84" |
proj |
projection coordinate system, e.g. "+proj=utm +zone=30 ellps=WGS84" |
Return a data.frame with column names "Lon" & "Lat". The unit of "Lon" & "Lat" is meter now.
Huidong Tian (tienhuitung@gmail.com)
camera.geo <- data.frame(Lon = rnorm(10, 120, 10), Lat = rnorm(10, 30, 5)) par(mfrow = c(1, 2)) with(camera.geo, plot(Lon, Lat, xlab = "Longitude", ylab = "Latitude", main = "Geographic coordinate system")) camera.proj <- geo2proj(camera.geo) with(camera.proj, plot(Lon, Lat, xlab = "Longitude", ylab = "Latitude", main = "Universal Transverse Mercator (UTM) \n Coordinate System"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.