View source: R/convert2PolySet.R
| convert2PolySet | R Documentation |
This function converts sf::st_sf() and
sp::SpatialPolygonsDataFrame() objects to
PBSmapping::PolySet() objects.
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)
x |
|
n_preallocate |
|
PBSmapping::PolySet() object.
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.
For a slower, more stable equivalent see
maptools::SpatialPolygons2PolySet.
## Not run:
# generate sf object
sim_pus <- sim.pus(225L)
# convert to PolySet
x <- convert2PolySet(sim_pus)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.