[geos-devel] New overlay validation, call for tests

Sandro Santilli strk at keybit.net
Wed Jul 31 02:51:00 PDT 2013

I've just committed in trunk a change in the overlay operation
heuristic to reduce the possibility of getting invalidly noded

We used to get unnoded output due to common-bits-reducer
heuristic introducing invalidities when moving the output
geometry back to its original position (the input geometries
were translated near the origin to have more computation bits).

The new code re-checks noding after shifting back and refuses
to accept a result if it isn't properly noded. This is still not
100% accurate in that results with mixed-typed components are
not really checked for self-intersection, so you can still get
such cases.

In addition, the code now checks if the input is valid before
trying the various heuristics, so that you would get a message
about that, which is usually easier to read. Example:

 => select st_union('POLYGON((0 0, 10 10, 10 0, 0 10, 0 0))'::geometry,
                    'POLYGON((0 0, 5 0, 5 5, 0 5, 0 0))'::geometry);
 ERROR:  GEOSUnion: TopologyException: Input geom 0 is invalid: Self-intersection at or near point 5 5 at 5 5

This will be in GEOS-3.4.0, which I'm trying to close ASAP, so please
run your tests against the trunk version in order to catch any problem

Thank you !


More information about the geos-devel mailing list