Intersect one or more polygons

intersect_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::gIntersection() on the full list, since rgeos::gIntersection() 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_intersect <- intersect_polygons(circles);
plot(circle_intersect, add=TRUE, col="gold", lwd=3);