Handle transformation of various inla objects according to coordinate
reference systems of crs
(from sf::st_crs()
), fm_crs
, sp::CRS
,
fm_CRS
, or INLA::inla.CRS
class.
fm_transform(x, crs, ...)# S3 method for default
fm_transform(x, crs, ..., crs0 = NULL)
## S3 method for class 'NULL'
fm_transform(x, crs, ...)
# S3 method for matrix
fm_transform(x, crs, ..., passthrough = FALSE, crs0 = NULL)
# S3 method for sf
fm_transform(x, crs, ..., passthrough = FALSE)
# S3 method for sfc
fm_transform(x, crs, ..., passthrough = FALSE)
# S3 method for sfg
fm_transform(x, crs, ..., passthrough = FALSE)
# S3 method for Spatial
fm_transform(x, crs, ..., passthrough = FALSE)
# S3 method for fm_mesh_2d
fm_transform(x, crs = fm_crs(x), ..., passthrough = FALSE, crs0 = fm_crs(x))
# S3 method for fm_collect
fm_transform(x, crs = fm_crs(x), ..., passthrough = FALSE, crs0 = NULL)
# S3 method for fm_lattice_2d
fm_transform(x, crs = fm_crs(x), ..., passthrough = FALSE, crs0 = fm_crs(x))
# S3 method for fm_segm
fm_transform(x, crs = fm_crs(x), ..., passthrough = FALSE, crs0 = fm_crs(x))
# S3 method for fm_list
fm_transform(x, crs, ...)
A transformed object, normally of the same class as the input object.
The object that should be transformed from it's current CRS to a new CRS
The target crs object
Potential additional arguments
The source crs object for spatial classes without crs information
Default is FALSE. Setting to TRUE allows objects with no CRS information to be passed through without transformation. Use with care!
fm_CRS()
fm_transform(
rbind(c(0, 0), c(0, 90), c(0, 91)),
crs = fm_crs("sphere"),
crs0 = fm_crs("longlat_norm")
)
Run the code above in your browser using DataLab