-
Notifications
You must be signed in to change notification settings - Fork 14
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
return the number of point within a radius #21
Comments
btw, in python, you can do this easily by using query_ball_point, see: |
Dear Xiaojie,
Thanks for your interest in ANN. I am afraid I do not currently have time to implement this feature but if you would like to make pull request, I will be happy to consider it.
I think it would probably make sense to have a separate function as in your python example. Best wishes,
Greg Jefferis.
…Sent from my iPhone
On 25 May 2017, at 04:08, Xiaojie Qiu ***@***.***> wrote:
btw, in python, you can do this easily by using query_ball_point, see:
https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.spatial.KDTree.query_ball_point.html#scipy.spatial.KDTree.query_ball_point
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@jefferis I just ran into the same problem. I am trying to implement a particular 2D clustering algorithm that would benefit from locating "most dense" areas. I cannot spare storing a full matrix (100 million points), but I could use an array listing number of closest points within a certain radius. I will try to look into making this happen and doing a PR if I can... |
OK. Thank you @romanzenka. I'm happy to answer questions. |
PS @romanzenka if you found a patch against https://github.com/jefferis/RANN2 considerably easier (it uses RCpp) then I might consider a CRAN submission for that. |
@jefferis Okay, I will look into RANN2 first. |
I sent a preliminary PR into RANN2 just to show what I'm thinking - with your approval I can finish this up in a more complete fashion. |
In page 10 of the manual of ANN (https://www.cs.umd.edu/~mount/ANN/Files/1.1.2/ANNmanual_1.1.pdf) . It mentioned that we can return the number of points within a radius when setting the ANNdist to sqRad and k = 0. This is very useful when we are trying to count the number of points for each sample whose distance is within the radius. Can you help to also return this value?
I think ANNkdFRPtsInRange is actually the value we want. But I don't know how can we return that value in the
get_NN_2Set
andnn2
functionThe text was updated successfully, but these errors were encountered: