get_epsg: Get EPSG Code

View source: R/spaceutils.R

get_epsgR Documentation

Get EPSG Code

Description

Get EPSG code for local UTM projection

Usage

get_epsg(x)

Arguments

x

Coordinates or spatial object

Details

This is a generic method to determine the EPSG code for a set of coordinates epsg.numeric will take a lonlat vector whereas epsg.sfc takes an sfc object and determines the EPSG code from the center of the bounding box. Computation is based on a method outlined in the text Geocomputation in R, by Robin Lovelace, section 7.3

Value

An integer with EPSG value

See Also

get_epsg.default()

get_epsg.sfc()

get_epsg.sf()

Examples

lonlat <- c(-76.2, 33.5)                 # coordinates
pt1 <- sf::st_point(lonlat)              # sfg object
pt2 <- sf::sfc(pt1)                      # sfc object
pt2 <- sf::st_sf(pt2)                    # sf object

get_epsg(lonlat)
get_epsg(pt1)
get_epsg(pt2)
get_epsg(pt3)

nhoteling/spaceheater documentation built on Sept. 24, 2022, 3:04 p.m.