Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. def intersect_polygons(poly, boundary):
  2. if poly.overlaps(boundary):
  3. poly = poly.intersection(boundary)
  4. return poly
  5.  
  6. # polygons is a list of shapely Polygon objects
  7. # boundary is a shapely Polygon object
  8. new_polygons = [intersect_polygons(p, boundary) for p in polygons]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement