-
Notifications
You must be signed in to change notification settings - Fork 57
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
Introduce nearest neighbor search for points #1528
Conversation
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1528 +/- ##
==========================================
+ Coverage 88.33% 88.40% +0.07%
==========================================
Files 362 362
Lines 27319 27426 +107
Branches 3682 3705 +23
==========================================
+ Hits 24131 24245 +114
+ Misses 1952 1945 -7
Partials 1236 1236 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
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.
This already looks very very promising and is also working like a charm (apart from a serious lifetime bug, which we fortunately haven't triggered so far:)).
I have left you an initial round of comments,
So you can work on improving this really really nice feature.
…into nearest-neighbor
Quality Gate passedIssues Measures |
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.
Thank you very much, I think we can merge this now.
SpatialJoin
nearest neighbor search
@ullingerc This is now active on our OSM Planet instance. I just noticed a small problem, which might have an easy fix. For example, consider https://qlever.cs.uni-freiburg.de/osm-planet/N1UUCA . QLever should compute the result of the subquery first (which contains the magic |
QLever now supports a special predicate
?left <nearest-neighbors:k> ?right
wherek
is a positive integer that is transformed into a spatial join operation which for each entry in?left
only returns thek
spatially closest elements in?right
.For the semantically correct usage, it is important that the
<nearest-neighbors>
join is performed as the last step, e.g. by putting the other constraints for?left
andright
into subqueries. In the future we probably want to replace this special predicate by a special construct that better reflects the non-commutativity of the nearest neighbor join.Currently, the nearest neighbor join (same as the
<max-distance-in-meters>
join only work for point objects). The join is implemented using Google'sS2
library, delivers the functionality for nearest neighbor search out of the box.