generalize.polys | R Documentation |
Generalises a SpatialPolygons
or SpatialPolygonsDataFrame
or a sf
-POLYGON or - MULTIPOLYGON object using the Douglas-Peuker algorithm
generalize.polys(sfo, preserveTopology, dTolerance)
sfo |
A |
preserveTopology |
logical; carry out topology preserving simplification? May be specified for each, or for all feature geometries. Note that topology is preserved only for single feature geometries, not for sets of them. |
dTolerance |
numeric; tolerance parameter, specified for all or for each feature geometry. |
Returns an object of the same class as sp
. Note that the algorithm is applied on a polygon-by-polygon,
not edge-by-edge basis. Thus edges in generalised polygons may not match perfectly.
An object of class SpatialPolygons
or SpatialPolygonsDataFrame
. Each polygon shape has been
generalized using the Douglas-Peuker algorithm.
Chris Brunsdon, Binbin Lu
# Data for Georgia to use in example
data(WHData)
WH.outline <- st_union(WHHP)
WH.generalised <- generalize.polys(WH.outline,TRUE,0.1)
plot(st_geometry(WHHP))
plot(st_geometry(WH.generalised),add=TRUE,border='red',lwd=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.