Replies: 1 comment 1 reply
-
|
Like many JTS operations, Invalid geometry can present in a multitude of different ways, and |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
While investigating onthegomap/planetiler#546 I found that
GeometryPrecisionReducercan sometimes invert a hole of a polygon that has a small self-intersection and treat it as a separate polygon. It looks like the root cause is thatEdgeNodingBuilderusesOrientation.isCCWon the inner ring, which gives the opposite result for that inner ring. Here is a simple test-case to reproduce:Which fails because
GeometryPrecisionReducerreturnsMULTIPOLYGON (((0 0, 0 1, 2 1, 2 0, 0 0)), ((0.9375 0.5625, 1.1875 0.875, 1.4375 0.8125, 0.9375 0.5625)))instead.Would it make sense to switch
EdgeNodingBuilderto useisCCWAreainstead ofisCCWwhich handles this case as we would expect? Or at least expose which orientation method it uses as an option toOverlayNGandPrecisionReducer? From a user perspective, it would also be fine for precision reducer to throw an exception in this case so we could re-try after fixing the polygon.I'd be happy to make the change if any of those sound like a feasible path forward?
Beta Was this translation helpful? Give feedback.
All reactions