peterstace / simplefeatures

Simple Features is a pure Go Implementation of the OpenGIS Simple Feature Access Specification
MIT License
134 stars 19 forks source link

Polygon Validation Error #631

Closed Amalio769 closed 2 months ago

Amalio769 commented 3 months ago

With a wrong Polygon (the internal ring is bigger that external one, and the internal one intersect with the external one in more than one point) the function Validate() work properly.

But if the internal ring intersect in only one point with the external ring, the function Validate don't work properly. Please, check this Polygon with the following coordinates: [[[1,1],[5,1],[5,5],[1,5],[1,1]],[[3,1],[6,0],[6,6],[0,6],[0,0],[3,1]]]

peterstace commented 3 months ago

Hi @Amalio769 , thank you for your report. I've confirmed that the geometry is invalid via QGIS, and I've been able to reproduce the bug in simplefeatures where it's erroneously indicating that it's valid. I'll look into a fix (I've got an intuitive understanding of where I think the problem most likely is).

peterstace commented 3 months ago

I've got the bug reproduction and fix in this branch: https://github.com/peterstace/simplefeatures/compare/master...polygon_validation_bug

(I'm going to get some eyes on it before merging it in)

Amalio769 commented 2 months ago

I've compile my repo with the new brach and all my tests work properly. Good job. Thank you very much.

peterstace commented 2 months ago

FYI the fix is in the v0.51.0 release. https://github.com/peterstace/simplefeatures/releases/tag/v0.51.0