powered by
Spatial*
Methods to coerce simple feature geometries to corresponding Spatial* objects
as_Spatial(from, cast = TRUE, IDs = paste0("ID", 1:length(from)))
object of class sfc_POINT, sfc_MULTIPOINT, sfc_LINESTRING, sfc_MULTILINESTRING, sfc_POLYGON, or sfc_MULTIPOLYGON.
sfc_POINT
sfc_MULTIPOINT
sfc_LINESTRING
sfc_MULTILINESTRING
sfc_POLYGON
sfc_MULTIPOLYGON
logical; if TRUE, st_cast from before converting, so that e.g. GEOMETRY objects with a mix of POLYGON and MULTIPOLYGON are cast to MULTIPOLYGON.
TRUE
from
GEOMETRY
POLYGON
MULTIPOLYGON
character vector with IDs for the Spatial* geometries
geometry-only object deriving from Spatial, of the appropriate class
Spatial
# NOT RUN { nc = st_read(system.file("shape/nc.shp", package="sf")) as_Spatial(st_geometry(nc[1,])) # }
Run the code above in your browser using DataLab