-
Notifications
You must be signed in to change notification settings - Fork 205
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
Use cached envelope for polygon-polygon euclidean distance #1093
Conversation
@@ -585,8 +586,18 @@ pub fn nearest_neighbour_distance<T>(geom1: &LineString<T>, geom2: &LineString<T | |||
where | |||
T: GeoFloat + RTreeNum, | |||
{ | |||
let tree_a: RTree<Line<_>> = RTree::bulk_load(geom1.lines().collect::<Vec<_>>()); | |||
let tree_b: RTree<Line<_>> = RTree::bulk_load(geom2.lines().collect::<Vec<_>>()); | |||
let tree_a: RTree<CachedEnvelope<Line<_>>> = RTree::bulk_load( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let tree_a: RTree<CachedEnvelope<Line<_>>> = RTree::bulk_load( | |
let tree_a = RTree::bulk_load( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like type inference also improved sometime around 2017
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
geom2 | ||
.lines() | ||
.map(CachedEnvelope::new) | ||
.collect::<Vec<_>>(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.collect::<Vec<_>>(), | |
.collect::<Vec<_>>(), |
CHANGES.md
if knowledge of this change could be valuable to users.Results in an 11 % - 14 % speedup on my machine