Closed grapemix closed 6 years ago
The search_nn_dist() return unexpected result to me and the test case for search_nn_dist() also miss some points. For example, in the test case:
points = [(x,y) for x in range(10) for y in range(10)] tree = kdtree.create(points) nn = tree.search_nn_dist((5,5), 2.5)
self.assertEqual(len(nn), 4) self.assertTrue( (6,6) in nn) self.assertTrue( (5,5) in nn) self.assertTrue( (5,6) in nn) self.assertTrue( (6,5) in nn)
The point(4,4) is missing. The Euclidean distance between (5,5) and (4,4) is 1.414214 and hence should be included if the radius param is 2.5.
Thanks.
Merged - thanks!
To respond #36