0

I have a Shapely Polygon and a LineString. I want to be able to determine which Polygon points are above the LineString and which are below. Alternatively, it would also be alright if I were to splice a Polygon using a LineString and generate two new Polygons.

Are there any built-in Shapely methods that would allow me to do this?

Savannah Ostrowski
  • 101
  • 1
  • 1
  • 9
  • Perhaps this helps with intersections https://gis.stackexchange.com/questions/119374/intersect-shapefiles-using-shapely – user30184 May 02 '17 at 21:35

1 Answers1

1

In case anyone else comes searching for this, you can use this to split the polygon into to sub-polygons and work from there:

merged = linemerge([poly.boundary, line])
borders = unary_union(merged)
polygons = polygonize(borders)

Check out this other post in support of this approach.

Savannah Ostrowski
  • 101
  • 1
  • 1
  • 9