[Deprecated] in favour of fmesher::fm_transform().

Handles transformation of various inla objects according to coordinate reference systems of sf::crs, sp::CRS or inla.CRS class.

inla.spTransform(x, CRSobj, ...)

Arguments

x

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

CRSobj

passed on as the crs argument to fmesher::fm_transform().

...

Potential other arguments for fmesher::fm_transform().

Value

The object is returned with its coordinates transformed

See also

Author

Finn Lindgren finn.lindgren@gmail.com

Examples


if (require("sf") && require("sp") && require("fmesher")) {
    latt <- inla.mesh.lattice(-10:10, 40:60)
    mesh1 <- inla.mesh.create(
        lattice = latt, extend = FALSE, refine = FALSE,
        crs = fm_CRS("longlat_norm")
    )
    mesh2 <- fm_transform(mesh1, fm_crs("lambert_globe"))
    print(summary(mesh1))
    print(summary(mesh2))
}
#> 
#> Manifold:	R2
#> CRS/LegacyPROJ4:	+proj=longlat +R=1 +no_defs
#> CRS/WKT: (only shown with verbose = TRUE)
#> Vertices:	441
#> Triangles:	800
#> Boundary segm.:	80 (4 groups: 1 2 3 4)
#> Interior segm.:	0
#> xlim:	-10 10
#> ylim:	40 60
#> zlim:	0 0
#> 
#> 
#> Manifold:	R2
#> CRS/LegacyPROJ4:	+proj=cea +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +ellps=sphere +units=km +no_defs
#> CRS/WKT: (only shown with verbose = TRUE)
#> Vertices:	441
#> Triangles:	800
#> Boundary segm.:	80 (4 groups: 1 2 3 4)
#> Interior segm.:	0
#> xlim:	-1111.949 1111.949
#> ylim:	4095.198 5517.445
#> zlim:	NA NA
#>