cdalitz/kdtree-cpp

can get the point index ?

zuixiaosanlang opened this issue · 3 comments

can get the point index ?

Can you please elaborate what you are trying to achieve?

If you are not interested in the point coordinates, but into some label assigned to each node (e.g. an index), you can use the property data of KdNode. Note that k_nearest_neighbors does not return points, but a KdNodeVector, so you can access the data attribute of the nodes.

@cdalitz
thank you. i get it

As I needed this myself, I have added an additional public attribute index to KdNode in the new release version 1.2.