inla.spTransform {INLA}R Documentation

Wrapper method for sp::spTransform

Description

Handles transformation of various inla objects accorting to coordinate reference systems of sp::CRS or inla.CRS class.

Usage

inla.spTransform(x, ...)

## Default S3 method:
inla.spTransform(x, crs0, crs1, passthrough = FALSE, ...)

## S3 method for class 'SpatialPoints'
inla.spTransform(x, CRSobj, passthrough = FALSE, ...)

## S3 method for class 'SpatialPointsDataFrame'
inla.spTransform(x, CRSobj, passthrough = FALSE, ...)

## S3 method for class 'inla.mesh.lattice'
inla.spTransform(x, CRSobj, passthrough = FALSE, ...)

## S3 method for class 'inla.mesh.segment'
inla.spTransform(x, CRSobj, passthrough = FALSE, ...)

## S3 method for class 'inla.mesh'
inla.spTransform(x, CRSobj, passthrough = FALSE, ...)

Arguments

x

The object that should be transformed from it's current CRS to a new CRS

...

Potential additional arguments

crs0

The source sp::CRS or inla.CRS object

crs1

The target sp::CRS or inla.CRS object

passthrough

default FALSE. Setting to TRUE allows objects with no CRS information to be passed through without transformation.

CRSobj

The target sp::CRS or inla.CRS object

Details

inla.spTransform.default Low level transformation of raw coordinates.

Value

The object is returned with its coordinates transformed

Author(s)

Finn Lindgren finn.lindgren@gmail.com

See Also

inla.CRS()

Examples


if (require(rgdal)) {
    latt <- inla.mesh.lattice(-10:10, 40:60)
    mesh1 <- inla.mesh.create(
        lattice = latt, extend = FALSE, refine = FALSE,
        crs = inla.CRS("longlat")
    )
    mesh2 <- inla.spTransform(mesh1, inla.CRS("lambert"))
    summary(mesh1)
    summary(mesh2)
}

[Package INLA version 21.11.22 Index]