inla.spTransform: Wrapper method for 'sp::spTransform'

Description Usage Arguments Value Author(s) See Also Examples

View source: R/spmesh.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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 '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

crs0

The source sp::CRS or inla.CRS object

crs1

The target sp::CRS or inla.CRS object

CRSobj

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.

...

Potential additional arguments

Value

The object is returned with its coordinates transformed

Author(s)

Finn Lindgren <finn.lindgren@gmail.com>

See Also

inla.CRS

Examples

1
2
3
4
5
6
7
8
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)
}

inbo/INLA documentation built on Dec. 6, 2019, 9:51 a.m.