proj_crs_text {PROJ} | R Documentation |
Generate a projection string.
Description
Input any accepted format of 'PROJ' coordinate reference system specification. Return value is a string in the requested format.
Usage
proj_crs_text(source, format = 0L)
Arguments
source |
input projection specification one of ('PROJ4', 'WKT2', 'EPSG', 'PROJJSON', ... see the library documentation link in Details) |
format |
integer, 0 for 'WKT', 1 for 'PROJ', 2 for 'PROJJSON' |
Details
This function requires PROJ version 6.0 or higher to be useful. If not, this function simply returns 'NA'.
See the library documentation for details on input and output formats.
Value
character string in requested format
warning
Note that a PROJ string is not a full specification, in particular this means that a string like "+proj=laea" cannot be converted to full WKT, because it is technically a transformation step not a crs. To get the full WKT form use a string like "+proj=laea +type=crs".
Examples
cat(proj_crs_text("EPSG:4326", format = 0L))
proj_crs_text("EPSG:4326", format = 1L)
south55 <- "+proj=utm +zone=55 +south +ellps=GRS80 +units=m +no_defs +type=crs"
proj_crs_text(proj_crs_text(south55), 1L)