sen2r (version 1.2.1)

st_crs2: Retrieve coordinate reference system from sf or sfc object

Description

This function is a wrapper for sf::st_crs, unless accepting also UTM timezones (see details) and threating numeric character strings as integers.

Usage

st_crs2(x, ...)

Arguments

x

numeric, character, or object of class sf or sfc

...

other parameters passed to sf::st_crs.

Value

If x is 0 < numeric <= 60, return crs object for UTM timezone x N; if x is numeric > 60, return crs object for SRID x; if x is character in the form nn, nnN or nnS, being nn a number 0 < nn <= 60, return crs object for UTM timezone x N or x S (N if not specified); if x is a different character, return crs object for proj4string x; if wkt is given, return crs object for well-known-text representation wkt; if x is of class sf or sfc, return its crs object.

Details

See sf::st_crs for details.

Examples

Run this code
# NOT RUN {
st_crs2("+init=epsg:32609")
st_crs2(32609)
st_crs2(9)
st_crs2("09")
st_crs2("9N")
st_crs2("09S")
# }

Run the code above in your browser using DataCamp Workspace