generalize.polys: generalize.polys

Description Usage Arguments Details Value Author(s) Examples

View source: R/poly.counts.R

Description

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

Usage

1

Arguments

sp

A SpatialPolygons or SpatialPolygonsDataFrame object.

tol

The weeding tolerance for the generalisation algorithm.

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

Examples

1
2
3
4
5
6
7
# Data for Georgia to use in example
data(georgia)
# Create an outline of Georgia
georgia.outline <- unionSpatialPolygons(georgia,rep(1,159))
plot(georgia.outline)
georgia.generalised <- generalize.polys(georgia.outline,0.1)
plot(georgia.generalised,add=TRUE,border='red')

Example output

Loading required package: maptools
Loading required package: sp
Checking rgeos availability: TRUE
Loading required package: RColorBrewer
Loading required package: MASS
Loading required package: rgeos
rgeos version: 0.3-23, (SVN revision 546)
 GEOS runtime version: 3.4.2-CAPI-1.8.2 r3921 
 Linking to sp version: 1.2-3 
 Polygon checking: TRUE 

NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files

GISTools documentation built on May 6, 2019, 1:09 a.m.