Skip to content
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

Improve LineSegment hashCode implementation #872

Merged
merged 1 commit into from
May 19, 2022

Conversation

dr-jts
Copy link
Contributor

@dr-jts dr-jts commented May 19, 2022

The current LineSegment hashcode implementation produces a lot of identical hashcodes. An improvement has been proposed in NetTopologySuite/NetTopologySuite#608. This is a port of that code, with a performance test showing that it makes a big difference in a synthetic test.

Testing using DiffSegments on real-world data doesn't show much difference, however. But still worth making this change.

Fixes #871

Signed-off-by: Martin Davis mtnclimb@gmail.com

Signed-off-by: Martin Davis <mtnclimb@gmail.com>
@dr-jts dr-jts self-assigned this May 19, 2022
@dr-jts dr-jts merged commit a75ff1e into locationtech:master May 19, 2022
@dr-jts dr-jts deleted the fix-linesegment-hashcode branch May 19, 2022 19:37
@jodygarnett jodygarnett added this to the 1.19.0 milestone Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Line Segment GetHashCode is prone to hash collision
2 participants