I have Shapely polygon geometries, A circle(c) and list of polygons within the circle. I want to find the union of the circle with the intersections. (circle + intersections)
I was trying to make a MultiPolygon of difference and intersection:
poly_list = [poly_N, poly_E]
# finding the intersection of circle and polys
intersec_list = []
for poly in poly_list:
intersec_list.append(circle.intersection(poly))
MP_intersec = MultiPolygon(intersec_list)
# finding the difference of circle and polygons
diff_list = []
for inter in intersec_list:
diffi = c.difference(inter)
MP_diff = MultiPolygon(diff_list)
# find the union of circle and intersection
# output: a MultiPolygon or a geometric collection with 4 polygons and the difference of circle.
MP_out = MultiPolygon([MP_diff, MP_intersec])
but MP_out gives invalid geometry probably because I have overlapping polygon as well.