[postgis-devel] Why delegating MakeValid to GEOS ?

Sandro Santilli strk at kbt.io
Thu Dec 10 13:35:14 PST 2020


On Fri, Dec 11, 2020 at 12:26:20AM +0300, Darafei "Komяpa" Praliaskouski wrote:
> Hi Sandro,
> 
> What is the actual problem you're trying to solve?

A testcase which passes when running against GEOS-3.6
and fails when running against 3.8. More specifically:
output of ST_MakeValid retaining (3.6) or not (3.8) the
empty components of collections.

> GEOSMakeValid builds a valid geom out of its input.
> LWMakeValid builds a valid geom out of its input.
> They differ in the details, but that wasn't a problem for years, and there
> isn't a test to pin either's minor behavior differences, only useful stuff.

The test I've added as part of my new work adding cleaning of NaN
coordinates. I could hide the dust under a carpet and NOT test
collections with components ending up EMPTY due to NaN coordinates
but I don't like hiding bugs...

My first approach has been to change ST_MakeValid behavior to also
strip the empty components, although it doesn't really sound like
being a job for ST_MakeValid to do that. Of course I'll resort to
that if there's no other viable solution, but if there's no compelling
reason to delegate ST_MakeValid fully to GEOSMakeValid I would rather
always use the PostGIS implementation, as long as we have it.

--strk;


More information about the postgis-devel mailing list