-
Notifications
You must be signed in to change notification settings - Fork 50
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
findAll( ) function #18
Conversation
This looks useful. A couple thoughts:
|
Good points. The name findAll does seem a little general, I think I like your suggestion of filter better... As far as code duplication goes, that might be able to be resolved using some sort of dependency injection? I'm not sure how much that would affect performance, but the differences between routines could be passed in rather than hard coded. This way could possibly also support other search cases such as a bounding box, polygon, or possibly even a k-nearest neighbor search without too much duplication. I'll take a look at it and see if I can come up with something. |
if I may add, a |
Hi, Thanks! |
It's not clear to me why findAll should be based on find. The crucial optimisation within But with findAll, we still have to visit all those quadrants that might contain an acceptable point within radius of the target, so this optimisation is not activated. Meaning that findAll is just a normal visit:
See the demo: https://observablehq.com/d/ff2450667f13132f |
Superseded by #32 |
Added a slight variation to the
find( )
method by creating afindAll( )
method which returns all points within a specified radius.This is based off of this example code.