Coordinate transformation for spatial objects
This is a wrapper for the spTransform function provided by the sp
package.
Given a spatial object (or a list thereof) it will transform the coordinate system according
to the parameter crs
. In addition to the usual spatial objects this function is
also capables of transforming INLA::inla.mesh
objects that are equipped with a coordinate
system.#'
stransform(splist, crs)
splist |
list of Spatial* objects |
crs |
Coordinate reference system to change to |
List of Spatial* objects
# Load Gorilla data data("gorillas", package = "inlabru") # Take the mesh and transform it to latitude/longitude tmesh <- stransform(gorillas$mesh, crs = CRS("+proj=longlat")) # Compare original and transformed mesh multiplot( ggplot() + gg(gorillas$mesh) + ggtitle("Original mesh"), ggplot() + gg(tmesh) + ggtitle("Transformed mesh") )
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.