<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
> About the union question, probably no good news there, unless your data has some very unlikely characteristics.  The GEOS Cascaded Union approach is remarkably efficient at unioning sets of overlapping polygons - which it sounds like you have.  The other alternative hack is to run buffer(0), but it is unlikely to be faster.<br>
<br>
Ok, thanks for the confirmation. Is there any benefit in "batching"<br>
sets of geometries to cascaded union (e.g. unioning 100 geometries in<br>
sets of 10, and then doing a final union of the result)? Or best to<br>
throw EVERYTHING at GEOS and let it sort it out?<br></blockquote><div><br></div><div>Best to let GEOS handle it.  It uses a spatial index to choose sets of polygons to union. It's unlikely you could do this better (unless there is some characteristic of the data you can take advantage of) </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> IF the data was a true polygonal coverage (i.e. strictly non-overlapping) then there is a faster approach in GEOSCoverageUniion.  [1].  But if you are trying to find gaps then it's likely your data is not a true coverage.<br>
<br>
Interesting. I have one application which would definitely benefit<br>
from this. GEOS 3.8 looks to be a very exciting release..! One thing I<br>
couldn't determine from the coverage PR and the docs of the new<br>
operation is what happens when the data **isn't** a non-overlapping<br>
coverage. Is the result total garbage in this case or is an exception<br>
raised? Are holes/non-contiguous parts allowed?<br><br></blockquote><div>It looks like GEOSCoverageUnion is able to detect non-fully-noded inputs [1] and overlaps [2], and throws an exception in this case.</div><div><br></div><div>I would think holes and non-contiguous parts are fine as input.</div><div><br></div><div>[1] <a href="https://github.com/libgeos/geos/pull/158/files#diff-7cd9f5f9244e77677b80591da3d99207R94">https://github.com/libgeos/geos/pull/158/files#diff-7cd9f5f9244e77677b80591da3d99207R94</a></div><div>[2] <a href="https://github.com/libgeos/geos/pull/158/files#diff-7cd9f5f9244e77677b80591da3d99207R123">https://github.com/libgeos/geos/pull/158/files#diff-7cd9f5f9244e77677b80591da3d99207R123</a></div></div></div>