-
Notifications
You must be signed in to change notification settings - Fork 456
Fix DepthSegment compareTo method #920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix DepthSegment compareTo method #920
Conversation
Signed-off-by: Martin Davis <mtnclimb@gmail.com>
Hello JTS Team, We just updated from JTS 1.19 to 1.20 and a the zero buffer operation is not always working. I have tracked down the changes and this commit seems to have broken it for our use-case. The compareTo() method now early outs when segments "touch" (upwardSeg.minX() >= other.upwardSeg.maxX()). When replacing these four lines with ">" instead of ">=" as was done in the old compareTo() the buffer operations works fine. Below a short example test where we buffer a collection and almost half of the collection is lost afterwards.
Red part of the collection is lost after the buffer operation. |
Weird. The behaviour of losing elements produces different results for different subsets of the input. This may be difficult to track down. |
I understand that it is difficult to track down, we have been using JTS for many years and this was not something we where able to find by our-self. The only thing that seems to fix it for our use-case is replacing:
|
@maximusgrey I created a separate issue for your problem: #1131 |
Fixes
DepthSegment.compareTo
method to obey contract for comparators.Signed-off-by: Martin Davis mtnclimb@gmail.com