generalize.polys: generalize.polys

View source: R/poly.counts.R

generalize.polysR Documentation

generalize.polys

Description

Generalises a SpatialPolygons or SpatialPolygonsDataFrame or a sf -POLYGON or - MULTIPOLYGON object using the Douglas-Peuker algorithm

Usage

generalize.polys(sfo, preserveTopology, dTolerance)

Arguments

sfo

A SpatialPolygons or SpatialPolygonsDataFrame or a sf -POLYGON or - MULTIPOLYGON object.

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.

Details

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.

Value

An object of class SpatialPolygons or SpatialPolygonsDataFrame. Each polygon shape has been generalized using the Douglas-Peuker algorithm.

Author(s)

Chris Brunsdon, Binbin Lu

Examples

# 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)


GISTools documentation built on Oct. 3, 2024, 1:08 a.m.