rgdal (version 1.4-3)

showWKT: Show Well-Known Text spatial reference system metadata

Description

Use GDAL/OGR spatial reference objects to convert a PROJ.4 representation to a Well-Known Text representation, and report an EPSG code if it can be determined by OGR SRS services.

Usage

showWKT(p4s, file = NULL, morphToESRI = TRUE)
showP4(wkt, morphFromESRI=TRUE)
showEPSG(p4s)

Arguments

p4s

A valid PROJ.4 string representing a spatial reference system

file

if not NULL, a file name to which the output Well-Known Text representation should be written

morphToESRI

default TRUE, morph the WKT string to the representation used by ESRI

wkt

A valid WKT character string representing a spatial reference system

morphFromESRI

default TRUE, morph the WKT string from the representation used by ESRI

Value

A character string containing the WKT representation of the PROJ.4 string.

References

http://www.gdal.org/osr_tutorial.html

See Also

is.projected, CRS-class

Examples

Run this code
# NOT RUN {
cities <- readOGR(system.file("vectors", package = "rgdal")[1], "cities")
readLines(system.file("vectors/cities.prj", package = "rgdal")[1])
showWKT(proj4string(cities))
showWKT("+init=epsg:28992")
showP4(showWKT("+init=epsg:28992"))
showEPSG("+proj=utm +zone=30")
showEPSG("+proj=longlat +ellps=WGS84")
# }

Run the code above in your browser using DataCamp Workspace