james-willis commented on issue #1612: URL: https://github.com/apache/sedona/issues/1612#issuecomment-2401048823
I performed some more testing and revised the Scala code above. There was a bug in my code. I found that both of Alex's geometries seem to be valid, and that JTS agrees they are valid. The bug seems to be in the [overlays implementation](https://github.com/locationtech/jts/blob/7ff33678ebdadc940adb2a8a967bda89b97ebd6b/modules/core/src/main/java/org/locationtech/jts/geom/GeometryOverlay.java#L71) that underlies the intersection method, which in turn underlies the Sedona ST_Intersection function. When jts.overlay is left as the default value, `SnapIfNeededOverlayOp` is used. When it is equal to ng, OverlayNGRobust is used. There are 3 more implementations of overlay I am aware of, OverlayOp, OverlayNG and SnapOverlayOp. These are not supported for use via the intersection method of the Geometry class. Of these 5 implementations, I found that only OverlayNGRobust works on both orderings of arguments for the geometries for intersection. The others fail on either one or both orderings of geometries -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
