I'm trying to convert water polygons (from osm) to land polygons. I haven't started with GeoSpark yet, but was hoping for some general advice.
Taking a rectangle polygon (-180,90 to 180,-90) and then simply cutting each polygon out of it is a non starter. It would become a giant complex multi polygon with millions of holes and basically eat all the memory.
What I *think* I ought to do is something like this:
1- start with envelope (-180,90 to 180-90)
2- count number of intersecting water polygons
3- if more than XX (say ten) then bisect the envelope and recurse
4- if less than XX then cut the ten polygons from the envelope and store as land poly
Basically creating a quadtree of smaller land polygons.
But doing this doesn't feel very efficient to do manually, or indeed very distributed. Is there a GeoSpark way to achieve a similar result?