sp::spTransforminla.spTransform.RdHandles transformation of various inla objects accorting to coordinate
reference systems of sp::CRS or inla.CRS class.
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, ...)The object that should be transformed from it's current CRS to a new CRS
The source sp::CRS or inla.CRS object
The target sp::CRS or inla.CRS object
The target sp::CRS or inla.CRS object
default FALSE. Setting to TRUE allows objects with no CRS information to be passed through without transformation.
Potential additional arguments
The object is returned with its coordinates transformed
inla.CRS
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)
}
#> Loading required package: rgdal
#> Warning: there is no package called ‘rgdal’