You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The non-integral coordinate POINT (-2 3.9999999999999996) is computed from the intersection of the following line segments (the first is the edge of the clipping rectangle, and the second is computed as the bisector between the two input points):
By comparing the ordinates of the bisector line, it is can be seen to be slightly off the expected angle of -45, due to the slight discrepancy in low-order decimal places:
This means that it cannot intersect the clipping square POLYGON ((-2 -2, -2 4, 4 4, 4 -2, -2 -2)) at corner points. This is visible when the topology is magnified:
This is likely caused by a change to make line intersection computation more robust by using DoubleDouble arithmetic (in #989). Ironically, in this case computing a more exact result is less accurate than the rounded result produced by standard floating-point arithmetic.
As with all floating-point computation, it's not possible to provide absolutely exact results, even in apparently simple cases where the theoretically correct is obvious by inspection. The most that can be expected is that results are within a small tolerance distance of the exact value. This is the case here. This is why VoronoiTestuses a distance tolerance.
Voronoi results incorrect in jts 1.20.0
The Voronoi diagram results are incorrect in JTS 1.20.0. It seems the results are not correctly clipped to the clip envelope.
The following code snippet demonstrates the issue:
JTS version 1.19.0 gives the correct result:
For convenience, the code I fed into jshell:
The text was updated successfully, but these errors were encountered: