SpatialPolygons2PolySet: Convert SpatialPolygons to PolySet data
Description
This function converts spatial SpatialPolygons and SpatialPolygonsDataFrame objects to PolySet objects.
Usage
SpatialPolygons2PolySet(x, n_preallocate)# S3 method for SpatialPolygonsDataFrame
SpatialPolygons2PolySet(x,
n_preallocate = 10000L)
# S3 method for SpatialPolygons
SpatialPolygons2PolySet(x, n_preallocate = 10000L)
Arguments
x
SpatialPolygons or SpatialPolygonsDataFrame object.
n_preallocate
integer How much memory should be preallocated for processing? Ideally, this number should equal the number of vertices in the SpatialPolygons object. If data processing is taking too long consider increasing this value.
See Also
For a slower, more stable equivalent see maptools::SpatialPolygons2PolySet.
Examples
Run this code# NOT RUN {
# generate SpatialPolygons object
sim_pus <- sim.pus(225L)
# convert to PolySet
x <- SpatialPolygons2PolySet(sim_pus)
# }
Run the code above in your browser using DataLab