Fork me on GitHub

Boolean operations

With two polygons a and b, you can compute boolean operations like this:

>>> union = Polygon.union(a,b)
>>> intersection = Polygon.intersect(a,b)
>>> difference = Polygon.subtract(a,b)

The return values will be lists of Polygons since the boolean operations can yield multiple result polygons.