Learn R Programming

ggOceanMaps (version 1.3.4)

convert_crs: convert_crs, system specific epsg code string formating for CRS.

Description

Temporary workaround for the specification of projargs in CRS(), required by migration to GDAL >= 3 and PROJ >= 6.

Usage

convert_crs(epsg = 4326)

Value

A character string that can be used as projargs in the CRS (sp) function: either a SRS_string (e.g. "EPSG:4326") or a "+init" PROJ string (e.g. "+init=epsg:4326"), depending on the libraries and packages versions used.

Arguments

epsg

EPSG code of the projection (coercible to a character string).

Author

Yves Reecht

Details

Test the version of GDAL, PROJ and sp, and return the appropriate format.

Examples

Run this code
convert_crs()
sp::CRS(projargs = convert_crs())
sp::CRS(projargs = convert_crs(epsg = 27700))

Run the code above in your browser using DataLab