Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def intersect_polygons(poly, boundary):
- if poly.overlaps(boundary):
- poly = poly.intersection(boundary)
- return poly
- # polygons is a list of shapely Polygon objects
- # boundary is a shapely Polygon object
- new_polygons = [intersect_polygons(p, boundary) for p in polygons]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement