justinethier/node-kdtree

feature k-nearest?

Closed this issue · 2 comments

Hey,

is there the possibility obtaining the 2 closest points?
If not, is it possible to remove a point from the kdtree so I could perform the tree.nearest query twice (without getting the same point twice).

Thanks

Unfortunately the underlying C library does not support either function: https://github.com/jtsiomb/kdtree

You could file an issue over there, or submit a pull request to add one of those features.

With regard to node-kdtree you could build a new tree with all of the points except the one you found, but obviously that solution isn't very efficient.

Okay I see,

never the less thanks for the fast information 👍