Obtain the 'EPSG' string from an object, if it has one. Supported inputs include sf.

crs_epsg(x, ...)

Arguments

x

object with 'EPSG' value

...

ignored

Value

integer (or NA)

References

EPSG website

See also

Examples

crs_epsg(sfx)
#> [1] 4326
x <- sfx attr(x$geom, "crs")$epsg <- NA ## oh no we lost it crs_epsg(x)
#> [1] NA