geo2proj: Convert longitude & latitude from geographic to projected...

View source: R/camera trap package E.r

geo2projR Documentation

Convert longitude & latitude from geographic to projected coordinate system

Description

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).

Usage

geo2proj(data, geo = NULL, proj = NULL)

Arguments

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"

Value

Return a data.frame with column names "Lon" & "Lat". The unit of "Lon" & "Lat" is meter now.

Author(s)

Huidong Tian (tienhuitung@gmail.com)

Examples


 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"))


Xinhai-Li/Rcameratrap documentation built on March 22, 2022, 9:57 a.m.