Learn R Programming

raptr (version 0.0.1)

SpatialPolygons2PolySet: Convert SpatialPolygons to PolySet data

Description

This function converts spatial SpatialPolygons and SpatialPolygonsDataFrame objects to PolySet objects.

Usage

SpatialPolygons2PolySet(x, n_preallocate)
"SpatialPolygons2PolySet"(x, n_preallocate = 10000L)
"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.

Value

PolySet object.

See Also

For a slower, more stable equivalent see maptools::SpatialPolygons2PolySet.

Examples

Run this code
# generate SpatialPolygons object
sim_pus <- sim.pus(225L)
# convert to PolySet
x <- SpatialPolygons2PolySet(sim_pus)

Run the code above in your browser using DataLab