[postgis-users] Strange behaviour from ST_MakeValid when holes escape polygon outer ring

Komяpa me at komzpa.net
Tue Oct 11 13:35:53 PDT 2016


ST_MakeValid tries to reconstruct geometry without losing vertices.

The only sane way I can think of to do it without losing vertices is to
stop treating the inner ring as inner ring and mark it as outer.

If you need a geometry fixup function that does processing with losing
vertices, ST_MakeValid isn't semantically what you need.

вт, 11 окт. 2016 г. в 23:24, Craig de Stigter <
craig.destigter at koordinates.com>:

> Hi folks
>
> We've been using an internal geometry-fixing function for a long time, and
> I'm looking into replacing it with ST_MakeValid().
>
> I've come across a strange edge-case where ST_MakeValid() appears to
> incorrectly treat polygons as a set of linework, rather than a shell and a
> set of holes.
>
> This means that when you give it a shape with a hole that partially
> escapes the exterior ring, instead of that part getting discarded it forms
> the outer ring of a new polygon, thus creating a multipolygon.
>
> I expected it to take the outer ring and ST_Difference() all the inner
> rings from the outer ring.
>
> Here's some screenshots to demonstrate:
>
> Actual:
> https://drive.google.com/file/d/0By4X8bGnhCGET3h1UU1GOW1NTDA/view?usp=sharing
> Expected:
> https://drive.google.com/file/d/0By4X8bGnhCGEQjdzQlpsY0xlelk/view?usp=sharing
>
> Would anyone who knows a bit more about ST_MakeValid() be able to comment
> on this? (If I dug into the source and was able to submit a patch to fix
> this, would it be likely to be accepted?)
>
> --
> Regards,
> Craig
>
> Developer
> Koordinates
>
> +64 21 256 9488 <+64%2021%20256%209488> / koordinates.com / @koordinates
> <https://twitter.com/koordinates>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20161011/0cd7d4a4/attachment.html>


More information about the postgis-users mailing list