[geos-devel] Progress on #837 - TopologyException in UnaryUnion

Sandro Santilli strk at kbt.io
Wed Apr 17 04:01:06 PDT 2019

On Mon, Apr 15, 2019 at 03:45:38PM -0700, Martin Davis wrote:

> I do have a slightly changed patch which runs all current test cases
> correctly, and provides similar performance to the original
> implementation.  The only catch is that I think it is theoretically not
> 100% safe, since it still leaves a small opening for having geometry
> perturbed by the union causing overlaps and thus invalid output.  This
> should be very rare though.

I don't think it should be ever accepted for a GEOS algorithm to
possibly return invalid outputs. That's a big cornerstone we're
building on. And was the main reason for me to look for a fix
(callers assume GEOS always returns valid ouput!).

An exception to this rule (always returning valid output) should
always be carefully documented (one case was ClipByBox2d, which
was recently also argued about if I recall correctly).

Can't we just always tell how much the perturbation was, by looking
at the bounding box of the unioned geometries ? I thought that's what
my change was doing but maybe it was just in planning and never went
ahead doing it (your "iterative" approach?)


More information about the geos-devel mailing list