Interface class to the PROJ projection and transformation system. The class is defined as an empty stub accepting value NA in the sp package. The initiation function may call the PROJ library through sf to verify the argument set against those known in the library, returning error messages where necessary. If the "CRS" object is instantiated using CRS() with sf using PROJ >= 6 and GDAL >= 3, the object may also have a WKT2 (2019) string carried as a comment. The arguments for a Proj.4 string must be entered exactly as in the Proj.4 documentation, in particular there cannot be any white space in +<key>=<value> strings, and successive such strings can only be separated by blanks. Note that only “+proj=longlat +ellps=WGS84” is accepted for geographical coordinates, which must be ordered (eastings, northings); the “+ellps=” definition must be given (or expanded internally from a given “+datum=” value) for recent versions of the Proj.4 library, and should be set to an appropriate value.

CRS(projargs, doCheckCRSArgs=TRUE, SRS_string=NULL, get_source_if_boundcrs=TRUE,
 use_cache=TRUE)
identicalCRS(x,y)

Objects from the Class

Objects can be created by calls of the form CRS("projargs"), where "projargs" is a valid string of PROJ.4 arguments. If the argument is a zero-length string or a character NA, the object records NA. If the "CRS" object is instantiated using CRS() with sf using PROJ >= 6 and GDAL >= 3, the object may also have a WKT2 (2019) string carried as a comment. The initiation function may call the PROJ library through sf to verify the argument set against those known in the library, returning error messages where necessary.

Slots

projargs:

Object of class "character": projection arguments; the arguments must be entered exactly as in the PROJ.4 documentation, in particular there cannot be any white space in +<arg>=<value> strings, and successive such strings can only be separated by blanks.

Methods

show

signature(object = "CRS"): print deprecated Proj.4 projection arguments and WKT2 2019 representation if available

wkt

signature(object = "CRS"): return WKT comment on object

rebuild_CRS

rebuild a CRS object, usually used to add a WKT comment with PROJ >= 6 and GDAL >= 3

Arguments

projargs

A character string of projection arguments; the arguments must be entered exactly as in the PROJ.4 documentation; if the projection is unknown, use as.character(NA), it may be missing or an empty string of zero length and will then set to the missing value. With sf built with PROJ >= 6 and GDAL >= 3, the +init= key may only be used with value epsg:<code>. From sp version 1.4-4, the string associated with the SRS_string argument may be entered as-is and will be set as SRS_string if the projargs argument does not begin with a + (suggested by Mikko Vihtakari).

doCheckCRSArgs

default TRUE

SRS_string

default NULL, only used when sf is built with PROJ >= 6 and GDAL >= 3; a valid WKT string or SRS definition such as "EPSG:4326" or "ESRI:102761"

get_source_if_boundcrs

(from rgdal 1.5-17, default TRUE) The presence of the +towgs84= key in a Proj4 string projargs= argument value may promote the output WKT2 CRS to BOUNDCRS for PROJ >= 6 and GDAL >= 3, which is a coordinate operation from the input datum to WGS84. This is often unfortunate, so a PROJ function is called through rgdal to retrieve the underlying source definition.

use_cache

default TRUE, if FALSE ignore cached lookup values

x

object having a proj4string method, or if y is missing, list with objects that have a proj4string method

y

object of class Spatial, or having a proj4string method

Value

CRS returns on success an object of class CRS. identicalCRS returns a logical, indicating whether x and y have identical CRS, or if y is missing whether all objects in list x have identical CRS.

Author

Roger Bivand Roger.Bivand@nhh.no

Note

Lists of projections may be seen by using the programs installed with the PROJ.4 library, in particular proj and cs2cs; with the latter, -lp lists projections, -le ellipsoids, -lu units, and -ld datum(s) known to the installed software (available in sf using sf_proj_info). These are added to in successive releases, so tracking the website or compiling and installing the most recent revisions will give the greatest choice. Finding the very important datum transformation parameters to be given with the +towgs84 tag is a further challenge, and is essential when the datums used in data to be used together differ. Tracing projection arguments is easier now than before the mass ownership of GPS receivers raised the issue of matching coordinates from different argument sets (GPS output and paper map, for example). See GridsDatums, sf_proj_info for help in finding CRS definitions.

The 4.9.1 release of the PROJ library omitted a small file of defaults, leading to reports of “major axis or radius = 0 or not given” errors. From 0.9-3, rgdal checks for the presence of this file (proj_def.dat), and if not found, and under similar conditions to those used by PROJ.4, adds “+ellps=WGS84” to the input string being checked by checkCRSArgs The “+no_defs” tag ignores the file of defaults, and the default work-around implemented to get around this problem; strings including “init” and “datum” tags also trigger the avoidance of the work-around. Now messages are issued when a candidate CRS is checked; they may be suppressed using suppressMessages.

From release 6 of the PROJ library, when used in building sf with GDAL >= 3, the +datum= key in the Proj.4 string CRS representation is deprecated, and the +towgs84= and +nadgrids= keys may be deprecated soon. For this reason, sp and sf are starting to use WKT2 (2019) string representations. In sp, the "CRS" object in itself remains unchanged, but the content of its "projargs" slot may be degraded. To work around the degradation, a comment is added around the "CRS" object containing a WKT2 (2019) string when sf is available and built with PROJ >= 6 and GDAL >=3.

Examples

CRS()
#> Coordinate Reference System:
#> Deprecated Proj.4 representation: NA 
CRS("")
#> Coordinate Reference System:
#> Deprecated Proj.4 representation: NA 
CRS(as.character(NA))
#> Coordinate Reference System:
#> Deprecated Proj.4 representation: NA 
CRS("+proj=longlat +datum=WGS84")
#> Coordinate Reference System:
#> Deprecated Proj.4 representation: +proj=longlat +datum=WGS84 +no_defs 
#> WKT2 2019 representation:
#> GEOGCRS["unknown",
#>     DATUM["World Geodetic System 1984",
#>         ELLIPSOID["WGS 84",6378137,298.257223563,
#>             LENGTHUNIT["metre",1]],
#>         ID["EPSG",6326]],
#>     PRIMEM["Greenwich",0,
#>         ANGLEUNIT["degree",0.0174532925199433],
#>         ID["EPSG",8901]],
#>     CS[ellipsoidal,2],
#>         AXIS["longitude",east,
#>             ORDER[1],
#>             ANGLEUNIT["degree",0.0174532925199433,
#>                 ID["EPSG",9122]]],
#>         AXIS["latitude",north,
#>             ORDER[2],
#>             ANGLEUNIT["degree",0.0174532925199433,
#>                 ID["EPSG",9122]]]] 
run <- FALSE
run <- require(sf) 
#> Loading required package: sf
#> Linking to GEOS 3.10.2, GDAL 3.4.1, PROJ 8.2.1; sf_use_s2() is TRUE
if (run) {
  print((CRS("+proj=longlat +datum=NAD27")))
}
#> Coordinate Reference System:
#> Deprecated Proj.4 representation: +proj=longlat +datum=NAD27 +no_defs 
#> WKT2 2019 representation:
#> GEOGCRS["unknown",
#>     DATUM["North American Datum 1927",
#>         ELLIPSOID["Clarke 1866",6378206.4,294.978698213898,
#>             LENGTHUNIT["metre",1]],
#>         ID["EPSG",6267]],
#>     PRIMEM["Greenwich",0,
#>         ANGLEUNIT["degree",0.0174532925199433],
#>         ID["EPSG",8901]],
#>     CS[ellipsoidal,2],
#>         AXIS["longitude",east,
#>             ORDER[1],
#>             ANGLEUNIT["degree",0.0174532925199433,
#>                 ID["EPSG",9122]]],
#>         AXIS["latitude",north,
#>             ORDER[2],
#>             ANGLEUNIT["degree",0.0174532925199433,
#>                 ID["EPSG",9122]]]] 
if (run) {
  print((CRS("+init=epsg:4267")))
}
#> Warning: GDAL Message 1: +init=epsg:XXXX syntax is deprecated. It might return a CRS with a non-EPSG compliant axis order.
#> Coordinate Reference System:
#> Deprecated Proj.4 representation: +proj=longlat +datum=NAD27 +no_defs 
#> WKT2 2019 representation:
#> GEOGCRS["NAD27",
#>     DATUM["North American Datum 1927",
#>         ELLIPSOID["Clarke 1866",6378206.4,294.978698213898,
#>             LENGTHUNIT["metre",1]],
#>         ID["EPSG",6267]],
#>     PRIMEM["Greenwich",0,
#>         ANGLEUNIT["degree",0.0174532925199433],
#>         ID["EPSG",8901]],
#>     CS[ellipsoidal,2],
#>         AXIS["longitude",east,
#>             ORDER[1],
#>             ANGLEUNIT["degree",0.0174532925199433,
#>                 ID["EPSG",9122]]],
#>         AXIS["latitude",north,
#>             ORDER[2],
#>             ANGLEUNIT["degree",0.0174532925199433,
#>                 ID["EPSG",9122]]],
#>     USAGE[
#>         SCOPE["unknown"],
#>         AREA["North and central America: Antigua and Barbuda - onshore. Bahamas - onshore plus offshore over internal continental shelf only. Belize - onshore. British Virgin Islands - onshore. Canada onshore - Alberta, British Columbia, Manitoba, New Brunswick, Newfoundland and Labrador, Northwest Territories, Nova Scotia, Nunavut, Ontario, Prince Edward Island, Quebec, Saskatchewan and Yukon - plus offshore east coast. Cuba - onshore and offshore. El Salvador - onshore. Guatemala - onshore. Honduras - onshore. Panama - onshore. Puerto Rico - onshore. Mexico - onshore plus offshore east coast. Nicaragua - onshore. United States (USA) onshore and offshore - Alabama, Alaska, Arizona, Arkansas, California, Colorado, Connecticut, Delaware, Florida, Georgia, Idaho, Illinois, Indiana, Iowa, Kansas, Kentucky, Louisiana, Maine, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Missouri, Montana, Nebraska, Nevada, New Hampshire, New Jersey, New Mexico, New York, North Carolina, North Dakota, Ohio, Oklahoma, Oregon, Pennsylvania, Rhode Island, South Carolina, South Dakota, Tennessee, Texas, Utah, Vermont, Virginia, Washington, West Virginia, Wisconsin and Wyoming - plus offshore . US Virgin Islands - onshore."],
#>         BBOX[7.15,167.65,83.17,-47.74]]] 
if (run) {
  print((CRS("+init=epsg:26978")))
}
#> Coordinate Reference System:
#> Deprecated Proj.4 representation:
#>  +proj=lcc +lat_0=36.6666666666667 +lon_0=-98.5 +lat_1=38.5666666666667
#> +lat_2=37.2666666666667 +x_0=400000 +y_0=400000 +datum=NAD83 +units=m
#> +no_defs 
#> WKT2 2019 representation:
#> PROJCRS["NAD83 / Kansas South",
#>     BASEGEOGCRS["NAD83",
#>         DATUM["North American Datum 1983",
#>             ELLIPSOID["GRS 1980",6378137,298.257222101,
#>                 LENGTHUNIT["metre",1]]],
#>         PRIMEM["Greenwich",0,
#>             ANGLEUNIT["degree",0.0174532925199433]],
#>         ID["EPSG",4269]],
#>     CONVERSION["SPCS83 Kansas South zone (meters)",
#>         METHOD["Lambert Conic Conformal (2SP)",
#>             ID["EPSG",9802]],
#>         PARAMETER["Latitude of false origin",36.6666666666667,
#>             ANGLEUNIT["degree",0.0174532925199433],
#>             ID["EPSG",8821]],
#>         PARAMETER["Longitude of false origin",-98.5,
#>             ANGLEUNIT["degree",0.0174532925199433],
#>             ID["EPSG",8822]],
#>         PARAMETER["Latitude of 1st standard parallel",38.5666666666667,
#>             ANGLEUNIT["degree",0.0174532925199433],
#>             ID["EPSG",8823]],
#>         PARAMETER["Latitude of 2nd standard parallel",37.2666666666667,
#>             ANGLEUNIT["degree",0.0174532925199433],
#>             ID["EPSG",8824]],
#>         PARAMETER["Easting at false origin",400000,
#>             LENGTHUNIT["metre",1],
#>             ID["EPSG",8826]],
#>         PARAMETER["Northing at false origin",400000,
#>             LENGTHUNIT["metre",1],
#>             ID["EPSG",8827]],
#>         ID["EPSG",11532]],
#>     CS[Cartesian,2],
#>         AXIS["(E)",east,
#>             ORDER[1],
#>             LENGTHUNIT["metre",1,
#>                 ID["EPSG",9001]]],
#>         AXIS["(N)",north,
#>             ORDER[2],
#>             LENGTHUNIT["metre",1,
#>                 ID["EPSG",9001]]],
#>     USAGE[
#>         SCOPE["unknown"],
#>         AREA["United States (USA) - Kansas - counties of Allen; Anderson; Barber; Barton; Bourbon; Butler; Chase; Chautauqua; Cherokee; Clark; Coffey; Comanche; Cowley; Crawford; Edwards; Elk; Finney; Ford; Franklin; Grant; Gray; Greeley; Greenwood; Hamilton; Harper; Harvey; Haskell; Hodgeman; Kearny; Kingman; Kiowa; Labette; Lane; Linn; Lyon; Marion; McPherson; Meade; Miami; Montgomery; Morton; Neosho; Ness; Osage; Pawnee; Pratt; Reno; Rice; Rush; Scott; Sedgwick; Seward; Stafford; Stanton; Stevens; Sumner; Wichita; Wilson; Woodson."],
#>         BBOX[36.99,-102.05,38.88,-94.6]]] 
if (run) {
  print((CRS(paste("+proj=sterea +lat_0=52.15616055555555",
 "+lon_0=5.38763888888889 +k=0.999908 +x_0=155000 +y_0=463000 +ellps=bessel",
 " +towgs84=565.237,50.0087,465.658,-0.406857,0.350733,-1.87035,4.0812 +units=m"))))
}
#> Coordinate Reference System:
#> Deprecated Proj.4 representation:
#>  +proj=sterea +lat_0=52.1561605555556 +lon_0=5.38763888888889
#> +k=0.999908 +x_0=155000 +y_0=463000 +ellps=bessel
#> +towgs84=565.237,50.0087,465.658,-0.406857,0.350733,-1.87035,4.08119999995016
#> +units=m +no_defs 
#> WKT2 2019 representation:
#> BOUNDCRS[
#>     SOURCECRS[
#>         PROJCRS["unknown",
#>             BASEGEOGCRS["unknown",
#>                 DATUM["Unknown based on Bessel 1841 ellipsoid",
#>                     ELLIPSOID["Bessel 1841",6377397.155,299.1528128,
#>                         LENGTHUNIT["metre",1,
#>                             ID["EPSG",9001]]]],
#>                 PRIMEM["Greenwich",0,
#>                     ANGLEUNIT["degree",0.0174532925199433],
#>                     ID["EPSG",8901]]],
#>             CONVERSION["unknown",
#>                 METHOD["Oblique Stereographic",
#>                     ID["EPSG",9809]],
#>                 PARAMETER["Latitude of natural origin",52.1561605555556,
#>                     ANGLEUNIT["degree",0.0174532925199433],
#>                     ID["EPSG",8801]],
#>                 PARAMETER["Longitude of natural origin",5.38763888888889,
#>                     ANGLEUNIT["degree",0.0174532925199433],
#>                     ID["EPSG",8802]],
#>                 PARAMETER["Scale factor at natural origin",0.999908,
#>                     SCALEUNIT["unity",1],
#>                     ID["EPSG",8805]],
#>                 PARAMETER["False easting",155000,
#>                     LENGTHUNIT["metre",1],
#>                     ID["EPSG",8806]],
#>                 PARAMETER["False northing",463000,
#>                     LENGTHUNIT["metre",1],
#>                     ID["EPSG",8807]]],
#>             CS[Cartesian,2],
#>                 AXIS["(E)",east,
#>                     ORDER[1],
#>                     LENGTHUNIT["metre",1,
#>                         ID["EPSG",9001]]],
#>                 AXIS["(N)",north,
#>                     ORDER[2],
#>                     LENGTHUNIT["metre",1,
#>                         ID["EPSG",9001]]]]],
#>     TARGETCRS[
#>         GEOGCRS["WGS 84",
#>             DATUM["World Geodetic System 1984",
#>                 ELLIPSOID["WGS 84",6378137,298.257223563,
#>                     LENGTHUNIT["metre",1]]],
#>             PRIMEM["Greenwich",0,
#>                 ANGLEUNIT["degree",0.0174532925199433]],
#>             CS[ellipsoidal,2],
#>                 AXIS["latitude",north,
#>                     ORDER[1],
#>                     ANGLEUNIT["degree",0.0174532925199433]],
#>                 AXIS["longitude",east,
#>                     ORDER[2],
#>                     ANGLEUNIT["degree",0.0174532925199433]],
#>             ID["EPSG",4326]]],
#>     ABRIDGEDTRANSFORMATION["Transformation from unknown to WGS84",
#>         METHOD["Position Vector transformation (geog2D domain)",
#>             ID["EPSG",9606]],
#>         PARAMETER["X-axis translation",565.237,
#>             ID["EPSG",8605]],
#>         PARAMETER["Y-axis translation",50.0087,
#>             ID["EPSG",8606]],
#>         PARAMETER["Z-axis translation",465.658,
#>             ID["EPSG",8607]],
#>         PARAMETER["X-axis rotation",-0.406857,
#>             ID["EPSG",8608]],
#>         PARAMETER["Y-axis rotation",0.350733,
#>             ID["EPSG",8609]],
#>         PARAMETER["Z-axis rotation",-1.87035,
#>             ID["EPSG",8610]],
#>         PARAMETER["Scale difference",1.0000040812,
#>             ID["EPSG",8611]]]] 
if (run) {
  print((CRS("+init=epsg:28992")))
}
#> Coordinate Reference System:
#> Deprecated Proj.4 representation:
#>  +proj=sterea +lat_0=52.1561605555556 +lon_0=5.38763888888889
#> +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs 
#> WKT2 2019 representation:
#> PROJCRS["Amersfoort / RD New",
#>     BASEGEOGCRS["Amersfoort",
#>         DATUM["Amersfoort",
#>             ELLIPSOID["Bessel 1841",6377397.155,299.1528128,
#>                 LENGTHUNIT["metre",1]]],
#>         PRIMEM["Greenwich",0,
#>             ANGLEUNIT["degree",0.0174532925199433]],
#>         ID["EPSG",4289]],
#>     CONVERSION["RD New",
#>         METHOD["Oblique Stereographic",
#>             ID["EPSG",9809]],
#>         PARAMETER["Latitude of natural origin",52.1561605555556,
#>             ANGLEUNIT["degree",0.0174532925199433],
#>             ID["EPSG",8801]],
#>         PARAMETER["Longitude of natural origin",5.38763888888889,
#>             ANGLEUNIT["degree",0.0174532925199433],
#>             ID["EPSG",8802]],
#>         PARAMETER["Scale factor at natural origin",0.9999079,
#>             SCALEUNIT["unity",1],
#>             ID["EPSG",8805]],
#>         PARAMETER["False easting",155000,
#>             LENGTHUNIT["metre",1],
#>             ID["EPSG",8806]],
#>         PARAMETER["False northing",463000,
#>             LENGTHUNIT["metre",1],
#>             ID["EPSG",8807]],
#>         ID["EPSG",19914]],
#>     CS[Cartesian,2],
#>         AXIS["(E)",east,
#>             ORDER[1],
#>             LENGTHUNIT["metre",1,
#>                 ID["EPSG",9001]]],
#>         AXIS["(N)",north,
#>             ORDER[2],
#>             LENGTHUNIT["metre",1,
#>                 ID["EPSG",9001]]],
#>     USAGE[
#>         SCOPE["unknown"],
#>         AREA["Netherlands - onshore, including Waddenzee, Dutch Wadden Islands and 12-mile offshore coastal zone."],
#>         BBOX[50.75,3.2,53.7,7.22]]] 
if (run) {
  print((CRS("EPSG:28992")))
}
#> Coordinate Reference System:
#> Deprecated Proj.4 representation:
#>  +proj=sterea +lat_0=52.1561605555556 +lon_0=5.38763888888889
#> +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs 
#> WKT2 2019 representation:
#> PROJCRS["Amersfoort / RD New",
#>     BASEGEOGCRS["Amersfoort",
#>         DATUM["Amersfoort",
#>             ELLIPSOID["Bessel 1841",6377397.155,299.1528128,
#>                 LENGTHUNIT["metre",1]]],
#>         PRIMEM["Greenwich",0,
#>             ANGLEUNIT["degree",0.0174532925199433]],
#>         ID["EPSG",4289]],
#>     CONVERSION["RD New",
#>         METHOD["Oblique Stereographic",
#>             ID["EPSG",9809]],
#>         PARAMETER["Latitude of natural origin",52.1561605555556,
#>             ANGLEUNIT["degree",0.0174532925199433],
#>             ID["EPSG",8801]],
#>         PARAMETER["Longitude of natural origin",5.38763888888889,
#>             ANGLEUNIT["degree",0.0174532925199433],
#>             ID["EPSG",8802]],
#>         PARAMETER["Scale factor at natural origin",0.9999079,
#>             SCALEUNIT["unity",1],
#>             ID["EPSG",8805]],
#>         PARAMETER["False easting",155000,
#>             LENGTHUNIT["metre",1],
#>             ID["EPSG",8806]],
#>         PARAMETER["False northing",463000,
#>             LENGTHUNIT["metre",1],
#>             ID["EPSG",8807]]],
#>     CS[Cartesian,2],
#>         AXIS["easting (X)",east,
#>             ORDER[1],
#>             LENGTHUNIT["metre",1]],
#>         AXIS["northing (Y)",north,
#>             ORDER[2],
#>             LENGTHUNIT["metre",1]],
#>     USAGE[
#>         SCOPE["Engineering survey, topographic mapping."],
#>         AREA["Netherlands - onshore, including Waddenzee, Dutch Wadden Islands and 12-mile offshore coastal zone."],
#>         BBOX[50.75,3.2,53.7,7.22]],
#>     ID["EPSG",28992]] 
if (run) {
  print((CRS(SRS_string="EPSG:28992")))
}
#> Coordinate Reference System:
#> Deprecated Proj.4 representation:
#>  +proj=sterea +lat_0=52.1561605555556 +lon_0=5.38763888888889
#> +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs 
#> WKT2 2019 representation:
#> PROJCRS["Amersfoort / RD New",
#>     BASEGEOGCRS["Amersfoort",
#>         DATUM["Amersfoort",
#>             ELLIPSOID["Bessel 1841",6377397.155,299.1528128,
#>                 LENGTHUNIT["metre",1]]],
#>         PRIMEM["Greenwich",0,
#>             ANGLEUNIT["degree",0.0174532925199433]],
#>         ID["EPSG",4289]],
#>     CONVERSION["RD New",
#>         METHOD["Oblique Stereographic",
#>             ID["EPSG",9809]],
#>         PARAMETER["Latitude of natural origin",52.1561605555556,
#>             ANGLEUNIT["degree",0.0174532925199433],
#>             ID["EPSG",8801]],
#>         PARAMETER["Longitude of natural origin",5.38763888888889,
#>             ANGLEUNIT["degree",0.0174532925199433],
#>             ID["EPSG",8802]],
#>         PARAMETER["Scale factor at natural origin",0.9999079,
#>             SCALEUNIT["unity",1],
#>             ID["EPSG",8805]],
#>         PARAMETER["False easting",155000,
#>             LENGTHUNIT["metre",1],
#>             ID["EPSG",8806]],
#>         PARAMETER["False northing",463000,
#>             LENGTHUNIT["metre",1],
#>             ID["EPSG",8807]]],
#>     CS[Cartesian,2],
#>         AXIS["easting (X)",east,
#>             ORDER[1],
#>             LENGTHUNIT["metre",1]],
#>         AXIS["northing (Y)",north,
#>             ORDER[2],
#>             LENGTHUNIT["metre",1]],
#>     USAGE[
#>         SCOPE["Engineering survey, topographic mapping."],
#>         AREA["Netherlands - onshore, including Waddenzee, Dutch Wadden Islands and 12-mile offshore coastal zone."],
#>         BBOX[50.75,3.2,53.7,7.22]],
#>     ID["EPSG",28992]] 
if (run) {
  o <- try(CRS(SRS_string="ESRI:102760"))
  if (!inherits(o, "try-error")) print((o))
}
#> Warning: GDAL Error 1: PROJ: proj_create_from_database: crs not found
#> Error in st_crs.character(SRS_string) : invalid crs: ESRI:102760
if (run) {
  o <- try(CRS("EPSG:4326"))
  if (!inherits(o, "try-error")) print((o))
}
#> Coordinate Reference System:
#> Deprecated Proj.4 representation: +proj=longlat +datum=WGS84 +no_defs 
#> WKT2 2019 representation:
#> GEOGCRS["WGS 84",
#>     ENSEMBLE["World Geodetic System 1984 ensemble",
#>         MEMBER["World Geodetic System 1984 (Transit)"],
#>         MEMBER["World Geodetic System 1984 (G730)"],
#>         MEMBER["World Geodetic System 1984 (G873)"],
#>         MEMBER["World Geodetic System 1984 (G1150)"],
#>         MEMBER["World Geodetic System 1984 (G1674)"],
#>         MEMBER["World Geodetic System 1984 (G1762)"],
#>         MEMBER["World Geodetic System 1984 (G2139)"],
#>         ELLIPSOID["WGS 84",6378137,298.257223563,
#>             LENGTHUNIT["metre",1]],
#>         ENSEMBLEACCURACY[2.0]],
#>     PRIMEM["Greenwich",0,
#>         ANGLEUNIT["degree",0.0174532925199433]],
#>     CS[ellipsoidal,2],
#>         AXIS["geodetic latitude (Lat)",north,
#>             ORDER[1],
#>             ANGLEUNIT["degree",0.0174532925199433]],
#>         AXIS["geodetic longitude (Lon)",east,
#>             ORDER[2],
#>             ANGLEUNIT["degree",0.0174532925199433]],
#>     USAGE[
#>         SCOPE["Horizontal component of 3D system."],
#>         AREA["World."],
#>         BBOX[-90,-180,90,180]],
#>     ID["EPSG",4326]] 
if (run) {
  o <- try(CRS("ESRI:102760"))
  if (!inherits(o, "try-error")) print((o))
}
#> Warning: GDAL Error 1: PROJ: proj_create_from_database: crs not found
#> Error in st_crs.character(projargs) : invalid crs: ESRI:102760
if (run) {
o <- new("Spatial")
proj4string(o) <- CRS("+init=epsg:27700")
}
if (run && !is.null(comment(slot(o, "proj4string")))) {
  cat(wkt(o), sep="\n")
  cat(wkt(slot(o, "proj4string")), sep="\n")
}
#> PROJCRS["OSGB36 / British National Grid",
#>     BASEGEOGCRS["OSGB36",
#>         DATUM["Ordnance Survey of Great Britain 1936",
#>             ELLIPSOID["Airy 1830",6377563.396,299.3249646,
#>                 LENGTHUNIT["metre",1]]],
#>         PRIMEM["Greenwich",0,
#>             ANGLEUNIT["degree",0.0174532925199433]],
#>         ID["EPSG",4277]],
#>     CONVERSION["British National Grid",
#>         METHOD["Transverse Mercator",
#>             ID["EPSG",9807]],
#>         PARAMETER["Latitude of natural origin",49,
#>             ANGLEUNIT["degree",0.0174532925199433],
#>             ID["EPSG",8801]],
#>         PARAMETER["Longitude of natural origin",-2,
#>             ANGLEUNIT["degree",0.0174532925199433],
#>             ID["EPSG",8802]],
#>         PARAMETER["Scale factor at natural origin",0.9996012717,
#>             SCALEUNIT["unity",1],
#>             ID["EPSG",8805]],
#>         PARAMETER["False easting",400000,
#>             LENGTHUNIT["metre",1],
#>             ID["EPSG",8806]],
#>         PARAMETER["False northing",-100000,
#>             LENGTHUNIT["metre",1],
#>             ID["EPSG",8807]],
#>         ID["EPSG",19916]],
#>     CS[Cartesian,2],
#>         AXIS["(E)",east,
#>             ORDER[1],
#>             LENGTHUNIT["metre",1,
#>                 ID["EPSG",9001]]],
#>         AXIS["(N)",north,
#>             ORDER[2],
#>             LENGTHUNIT["metre",1,
#>                 ID["EPSG",9001]]],
#>     USAGE[
#>         SCOPE["unknown"],
#>         AREA["United Kingdom (UK) - offshore to boundary of UKCS within 49°45'N to 61°N and 9°W to 2°E; onshore Great Britain (England, Wales and Scotland). Isle of Man onshore."],
#>         BBOX[49.75,-9,61.01,2.01]]]
#> PROJCRS["OSGB36 / British National Grid",
#>     BASEGEOGCRS["OSGB36",
#>         DATUM["Ordnance Survey of Great Britain 1936",
#>             ELLIPSOID["Airy 1830",6377563.396,299.3249646,
#>                 LENGTHUNIT["metre",1]]],
#>         PRIMEM["Greenwich",0,
#>             ANGLEUNIT["degree",0.0174532925199433]],
#>         ID["EPSG",4277]],
#>     CONVERSION["British National Grid",
#>         METHOD["Transverse Mercator",
#>             ID["EPSG",9807]],
#>         PARAMETER["Latitude of natural origin",49,
#>             ANGLEUNIT["degree",0.0174532925199433],
#>             ID["EPSG",8801]],
#>         PARAMETER["Longitude of natural origin",-2,
#>             ANGLEUNIT["degree",0.0174532925199433],
#>             ID["EPSG",8802]],
#>         PARAMETER["Scale factor at natural origin",0.9996012717,
#>             SCALEUNIT["unity",1],
#>             ID["EPSG",8805]],
#>         PARAMETER["False easting",400000,
#>             LENGTHUNIT["metre",1],
#>             ID["EPSG",8806]],
#>         PARAMETER["False northing",-100000,
#>             LENGTHUNIT["metre",1],
#>             ID["EPSG",8807]],
#>         ID["EPSG",19916]],
#>     CS[Cartesian,2],
#>         AXIS["(E)",east,
#>             ORDER[1],
#>             LENGTHUNIT["metre",1,
#>                 ID["EPSG",9001]]],
#>         AXIS["(N)",north,
#>             ORDER[2],
#>             LENGTHUNIT["metre",1,
#>                 ID["EPSG",9001]]],
#>     USAGE[
#>         SCOPE["unknown"],
#>         AREA["United Kingdom (UK) - offshore to boundary of UKCS within 49°45'N to 61°N and 9°W to 2°E; onshore Great Britain (England, Wales and Scotland). Isle of Man onshore."],
#>         BBOX[49.75,-9,61.01,2.01]]]