What does nearest neighbor to a point mean in the docs?
# Find the nearest neighbors in the RTree to the point (5, 5)
results = rt.neighbors(tree, 5, 5)
What is the definition of nearest (or distance in general) between bounding boxes (rectangles) and a point here?
It's the distance to the closest point of the box. If the point is inside the box, it has a distance of 0; otherwise some point on the exterior of the box is used.
This is the function used to find the nearest corner or edge of the box: https://github.com/kylebarron/geo-index/blob/9ca258bf397250c46b52e0abaef47e29a5c71913/src/rtree/trait.rs#L295-L306
(I'm not sure the ordering for nearest boxes when multiple have a distance of 0, maybe it's undefined)
Thanks for the swift reply.
We can keep this open to add this explanation to the docs.