thinnedSpatialPoly {Guerry}R Documentation

Thin a SpatialPolygons* object using the Douglas-Peucker polyLine simplification algorithm

Description

The function "thins" a SpatialPolygons or SpatialPolygonsDataFrame object, by reducing the number of points required to represent each line in the spatial polygons defining the map.

For map-based graphics using complex maps (such as gfrance) and rendered using vector graphics devices (pdf, postscript), thinning the base map can vastly reduce the size of the resulting graphic output files.

Usage

thinnedSpatialPoly(SP, tolerance, minarea=0)

Arguments

SP A SpatialPolygons or SpatialPolygonsDataFrame object
tolerance tolerance used by the dp function. The scale used for tolerance corresponds to the range of map coordinates, but is not documented precisely. If not supplied, the function uses the minimum range of the bounding box of the map / 100.
minarea The minimum area of polygons to keep in the resulting object. The default, minarea=0 means that all polygons, even tiny bits and slivers are retained. Typically, you will want to set this to something larger.

Value

Returns an object of the same class as the input, SP.

Warning

The dp function used here is not topology-preserving and may create visual artifacts (slivers, overlapping boundaries).

Author(s)

Roger Bivand, packaged by Michael Friendly

References

Douglas, D. and Peucker, T. (1973). Algorithms for the reduction of the number of points required to represent a digitized line or its caricature. The Canadian Cartographer, 10(2). 112-122

See Also

dp

Examples

        object.size(gfrance)
## not run, because shapefiles::dp uses T and F, causing R CMD check to fail
## Not run: 
        gfrance_dp <- thinnedSpatialPoly(gfrance, tolerance=2500, minarea=500000)
        object.size(gfrance_dp)
## End(Not run)

[Package Guerry version 1.3 Index]