<div dir="ltr">Hi folks<div><br></div><div>We've been using an internal geometry-fixing function for a long time, and I'm looking into replacing it with ST_MakeValid().</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>I expected it to take the outer ring and ST_Difference() all the inner rings from the outer ring.</div><div><br></div><div>Here's some screenshots to demonstrate:</div><div><br></div><div>Actual: <a href="https://drive.google.com/file/d/0By4X8bGnhCGET3h1UU1GOW1NTDA/view?usp=sharing">https://drive.google.com/file/d/0By4X8bGnhCGET3h1UU1GOW1NTDA/view?usp=sharing</a><br></div><div>Expected: <a href="https://drive.google.com/file/d/0By4X8bGnhCGEQjdzQlpsY0xlelk/view?usp=sharing">https://drive.google.com/file/d/0By4X8bGnhCGEQjdzQlpsY0xlelk/view?usp=sharing</a><br clear="all"><div><br></div><div>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?)</div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div style="color:rgb(0,0,0);font-family:helvetica;font-size:12px">Regards,</div><div style="color:rgb(0,0,0);font-family:helvetica;font-size:12px">Craig</div><div style="color:rgb(0,0,0);font-family:helvetica;font-size:12px"><br></div><div style="color:rgb(0,0,0);font-family:helvetica;font-size:12px">Developer</div><div style="color:rgb(0,0,0);font-family:helvetica;font-size:12px">Koordinates</div><div style="color:rgb(0,0,0);font-family:helvetica;font-size:12px"><br></div><div style="color:rgb(0,0,0);font-family:helvetica;font-size:12px"><a href="tel:+64%2021%20256%209488" style="color:rgb(17,85,204)" target="_blank">+64 21 256 9488</a> / <a href="http://koordinates.com/" style="color:rgb(17,85,204)" target="_blank">koordinates.com</a> / <a href="https://twitter.com/koordinates" style="color:rgb(17,85,204)" target="_blank">@koordinates</a></div></div></div>
</div></div>