-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
WIP geodetic distance search #1086
base: main
Are you sure you want to change the base?
Conversation
Added NearFilter unit test with real lat-long data. The current implementation of NearFilter doesn't return the expected results. See this shared custom map on Google Maps for an illustration of the Oslo test case: https://www.google.com/maps/d/viewer?mid=1WXlEa5nBOSvBej3HSUNhsh_LLahoab8
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@@ -0,0 +1,45 @@ | |||
package org.locationtech.jts.util; |
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.
Lets use nitrite package name here.
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.
Ah, I thought this needed to be in the same package as the existing GeometricShapeFactory
in order to access the protected fields, but I see now that I was misremembering my Java inheritance visibility rules! 😄 I did a quick refactor and it works just fine. Pushing an update...
Your changes looks great to me. |
Thanks for the quick feedback Anindya! Since these changes don't actually work yet, due to the bounding box problem, please advise how you'd recommend proceeding. There seem to be some simple options, e.g. we can use the set of My concern here is that I don't want to start pulling threads and turning this into a larger change because I haven't taken the time to understand the philosophy of how you split the work of the query up across these different layers. (Hence why this PR is a Draft.) |
After a quick review, I see one way we can move forward:
If you find a better way don't hesitate to share also. |
Thanks, I'll give it a try and see how the code shapes up! |
Also, how much weight should we be putting on avoiding breaking interface changes? Theoretically, someone out there may have taken a dependency on Nitrite 4.x and created their own implementation class for the We could just mark the existing methods as |
Ofcourse we should keep them backward compatible for next minor version upgrade and create overloaded methods to add |
As I started looking at the four implementations of ConsiderationsConcrete technical considerationsIf we add the More importantly, it is my understanding that this would be redundant data. The geometry data could be both in the main collection/repository map as well in the RTree map. (e.g. I see that both the Intuitive considerations based on application of general software-design principlesI tried to peel the next layer of the onion to figure out how to judge whether this is an appropriate trade-off in context. This led me to (a) look at the implementation of Admittedly, on the one hand, for every other type of Index we have, full data of the field being indexed becomes the content of the index alongside the ids. As such, there's an expectation that those indices would enable a wide range of filter operations because those operations would have access to the "complete" data of the indexed field. On the other hand, it seems that a spatial index is necessarily different by it's nature. The R-Tree is built on the idea that using only the bounding boxes this comes with significant benefits that outweigh its significant limitations. If we extend it, it's not really just an R-Tree anymore. ConclusionOn balance, I think this adds up to strong reason to prefer the approach where we treat each Sorry for the novella-length analysis. 😄 I look forward to hearing what you think. |
Thanks for the detailed analysis. While filtering via bounding box (using the current algorithm) the resulting set of |
Why
With some additional work, this branch is intended to fix issue #1079. In its current state, there is still an unresolved issue where both
NearFilter
andWithinFilter
actually just checking the minimal bounding box and never test the actual geometry.My intended next step is to discuss the best path forward. I have left detailed notes in the form of a comment in the code with my understanding of options for expanding the fix.
What
net.sf.geographiclib : GeographicLib-Java : 2.0
innitrite-spatial/pom.xml
WithinFilter
once I stepped through in the debugger and saw thatSpatialIndex.java
is mistakenly treating the filter work as done after the initial RTree check. Sure enough, the same problem occurs forWithinFilter
. I added an ASCII diagram in a comment within the new unit test,testWithinTriangleNotJustTestingBoundingBox
.