Learn R Programming

inlabru (version 2.6.0)

fm_sp_get_crs: Extract CRS information

Description

Wrapper for CRS(projargs) (PROJ4) and CRS(wkt) for sp::Spatial objects.

Usage

fm_sp_get_crs(x)

Value

A CRS object, or NULL if no valid CRS identified

Arguments

x

A sp::Spatial object

Author

Finn Lindgren finn.lindgren@gmail.com

Details

This function is a convenience method to workaround PROJ4/PROJ6 differences, and the lack of a crs extraction method for Spatial objects.

Examples

Run this code
if (FALSE) {
if (interactive()) {
  s <- sp::SpatialPoints(matrix(1:6, 3, 2), proj4string = fm_CRS("sphere"))
  fm_sp_get_crs(s)
}
}

Run the code above in your browser using DataLab