Learn R Programming

gdalraster (version 1.11.1)

epsg_to_wkt: Convert spatial reference from EPSG code to OGC Well Known Text

Description

epsg_to_wkt() exports the spatial reference for an EPSG code to WKT format.

Usage

epsg_to_wkt(epsg, pretty = FALSE)

Value

Character string containing OGC WKT.

Arguments

epsg

Integer EPSG code.

pretty

Logical. TRUE to return a nicely formatted WKT string for display to a person. FALSE for a regular WKT string (the default).

Details

As of GDAL 3.0, the default format for WKT export is OGC WKT 1. The WKT version can be overridden by using the OSR_WKT_FORMAT configuration option (see set_config_option()). Valid values are one of: SFSQL, WKT1_SIMPLE, WKT1, WKT1_GDAL, WKT1_ESRI, WKT2_2015, WKT2_2018, WKT2, DEFAULT. If SFSQL, a WKT1 string without AXIS, TOWGS84, AUTHORITY or EXTENSION node is returned. If WKT1_SIMPLE, a WKT1 string without AXIS, AUTHORITY or EXTENSION node is returned. WKT1 is an alias of WKT1_GDAL. WKT2 will default to the latest revision implemented (currently WKT2_2018). WKT2_2019 can be used as an alias of WKT2_2018 since GDAL 3.2

See Also

srs_to_wkt()

Examples

Run this code
epsg_to_wkt(5070)
writeLines(epsg_to_wkt(5070, pretty=TRUE))
set_config_option("OSR_WKT_FORMAT", "WKT2")
writeLines(epsg_to_wkt(5070, pretty=TRUE))
set_config_option("OSR_WKT_FORMAT", "")

Run the code above in your browser using DataLab