small_chop: Cut out small islands and enclaves

Description Usage Arguments Value Examples

Description

Remove satellite polygons in a SpatialPolygons or SpatialPolygonsDataFrame object. For each compound polygon, remove all but the largest component. Useful for generalised representations.

Usage

1
2
small_chop(spdf)
spdf %>% small_chop

Arguments

spdf

a SpatialPolygons or SpatialPolygonsDataFrame object

Value

a SpatialPolygons object with satellite polygons removed (IDs are the same as spdf)

Examples

1
2
3
4
5
6
7
8
9
data(RA)
RA.spdf %>% small_chop %>% plot
'MULTIPOLYGON (((3 2, 4.5 4, 1 4, 3 2)),((15 5, 40 10, 10 20, 5 10, 15 5)))' %>% readWKT -> p1
'darksalmon' %>% adjustcolor(alpha.f=0.5) -> salmon
old.mf <- par('mfrow')
par(mfrow=c(1,2))
p1 %>% plot(col=salmon); title("Before")
p1 %>% small_chop %>% plot(col=salmon); title("After")
par(mfrow=old.mf)

chrisbrunsdon/caricRture documentation built on May 13, 2019, 6:52 p.m.