Return the value of a parameter (or the name) present in the WKT of the given proj4string.

projpar(proj4string, par, abort = FALSE)

projname(proj4string, abort = FALSE)

Arguments

proj4string

The proj4string to be named (a character or a CRS object).

par

Character corresponding to the parameter name.

abort

logical: if TRUE, the function aborts in case an invalid proj4string is passed; if FALSE (default), the function returns NA, and a warning is shown.

Value

A character with the content of the parameter (NULL if the parameter is not recognised) or the name of the projection, and an attribute proj4string with the input projection checked using sf::st_crs().

Note

Python is needed.

Examples

# NOT RUN {
projpar("+init=epsg:4326", "Unit")
# }# NOT RUN {
projname("+init=epsg:4326")
# }