Obtain the 'input' string from an object, if it has one. Supported inputs include sf (>= 0.8-1 - probably).

crs_input(x, ...)

Arguments

x

object with 'input' value

...

ignored

Value

character (or NA)

Warning

Note that the 'input' value could be almost anything, there is a huge variety of inputs that can work such as 4326, projstrings, WKT2 strings, EPSG declarations 'EPSG:4326', or common strings like 'WGS84' or 'NAD27'.

Strings like '+init=epsg:4326' have been deprecated but still can work, so beware.

References

sf

See also

Examples

crs_input(sfx) ## doesn't have one
#> [1] NA
crs_input(sfx_new) ## a proj4string
#> [1] "+proj=longlat +datum=WGS84 +no_defs"