Union one or more polygons

union_polygons(sp, ...)

Arguments

sp

list object that contains one or more sp::SpatialPolygons.

...

additional arguments are ignored.

Value

object sp::SpatialPolygons

Details

This function takes a list of sp::SpatialPolygons objects, and performs iterative rgeos::gUnion() on the full list, since rgeos::gUnion() only operates on two polygons at a time.

Examples

circles <- get_venn_shapes(c(A=1, B=1, C=1))
col3 <- c("#FF000077", "#DDDD0088", "#0000FF77")
sp::plot(circles, col=col3)

circle_union <- union_polygons(circles);
plot(circle_union, add=TRUE, col="#FFDD0088", lwd=3);