[postgis-devel] ST_MakeValid() behaviour

Martin Davis mtnclimb at gmail.com
Sun Apr 18 21:33:10 PDT 2021

On Sun, Apr 18, 2021 at 12:15 PM Sandro Santilli <strk at kbt.io> wrote:

> NOTE: I remember many cases of Shapefiles where the winding
>       order of holes or exterior rings was wrong, resulting
>       in validities like "hole outside shell". This is to say
>       that "retain meaning of exterior/interior" is not necessarely
>       "better" than "retain all vertices".

Agreed, that is a scenario where the MakeValid "polygonize the lines"
approach could be more useful than the GeometryFixer "keep shells and
holes" strategy.

It seems like a characteristic of this scenario is that a shell is nested
inside a hole, and holes are wholly outside their shells.  This should be
easily detectable.  So perhaps there's an option to switch the behaviour of
GeometryFixer in these cases (either as the standard strategy or as an

Are there other situations where this is NOT desirable behaviour?

Also note that this does not imply fully reproducing the idea of "retain
all vertices".  In particular, MakeValid can include some kinds of polygon
boundaries as lines in polygon output, whereas GeometryFixer never adds
lines to polygonal output.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20210418/7b8431c5/attachment.html>

More information about the postgis-devel mailing list