inla.sp_get_crs {INLA} | R Documentation

## Extract CRS information

### Description

Use `fmesher::fm_CRS()` instead.

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

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

### Usage

    inla.sp_get_crs(x)

### Arguments

`x` | A `sp::Spatial` object

### Value

A `CRS` object, or NULL if no valid CRS identified

### Author(s)

Finn Lindgren finn.lindgren@gmail.com

### Examples

    ## Not run:
    if (require("sp", quietly = TRUE) && interactive()) {
        s <- sp::SpatialPoints(matrix(1:6, 3, 2), proj4string = fmesher::fm_CRS("sphere"))
        inla.sp_get_crs(s)
    }

    ## End(Not run)

[Package INLA version 26.08.22 Index]