I'm trying to write a PostGIS query to do the following:
- Get polygons from a table that overlap geometry A above (in this case, B and C).
- Get the intersecting area.
- Split the intersecting area by the overlapping polygons (in this case, returning D and E).
In this case there are 2 overlapping polygons, but I need to support an arbitrary number.
I'm stuck on how to get started with this. I know I can use ST_Intersects
to get the intersecting polygons and ST_Intersection
to get the overlapping area, but I'm not sure the splitting will work. It looks like ST_Split
only accepts two geometries Can anyone think of how I could get this to work with n polygons?