hull_it: Make all polygons in an object convex

Description Usage Arguments Value Examples

Description

Replace polygons in SpatialPolygons or SpatialPolygonsDataFrame with convex hulls

Usage

1
2
hull_it(spdf)
spdf 

Arguments

spdf

a SpatialPolygons or SpatialPolygonsDataFrame object

Value

a SpatialPolygons object with convex hulls of polygons (may overlap)

Examples

1
2
3
4
5
"MULTIPOLYGON (((30 20, 45 40, 35 35, 25 35, 10 40, 30 20)),
   ((15 5, 40 8, 40 10, 35 8, 10 20, 5 10, 15 5)))" %>% readWKT -> p1
'lavender' %>% adjustcolor(alpha.f=0.5) %>% lav
p1 %>% plot(col=lav)
p1 %>% hull_it %>% plot(col=lav,add=TRUE)

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