convert2PolySet {raptr} | R Documentation |
Convert object to PolySet data
Description
This function converts sf::st_sf()
and
sp::SpatialPolygonsDataFrame()
objects to
PBSmapping::PolySet()
objects.
Usage
convert2PolySet(x, n_preallocate)
## S3 method for class 'SpatialPolygonsDataFrame'
convert2PolySet(x, n_preallocate = 10000L)
## S3 method for class 'SpatialPolygons'
convert2PolySet(x, n_preallocate = 10000L)
## S3 method for class 'sf'
convert2PolySet(x, n_preallocate = 10000L)
Arguments
x |
|
n_preallocate |
|
Value
PBSmapping::PolySet()
object.
Note
Be aware that this function is designed to be as fast as possible, but as a result it depends on C++ code and if used inappropriately this function will crash R.
See Also
For a slower, more stable equivalent see
maptools::SpatialPolygons2PolySet
.
Examples
## Not run:
# generate sf object
sim_pus <- sim.pus(225L)
# convert to PolySet
x <- convert2PolySet(sim_pus)
## End(Not run)
[Package raptr version 1.0.1 Index]