geo-index icon indicating copy to clipboard operation
geo-index copied to clipboard

RTree searches: return iterator for nearest neighbor search

Open kylebarron opened this issue 10 months ago • 0 comments
trafficstars

Right now, our nearest neighbors implementation returns a materialized vec of all values that are within max_distance and max_results, but instead it would be cleaner to just return an iterator. I.e. this loop:

https://github.com/kylebarron/geo-index/blob/c5300f4bd6a359df1b4d6a704e67e65c7a7b9143/src/rtree/trait.rs#L195-L206

that results.push(item.0.id >> 1); should yield instead of return.

kylebarron avatar Jan 02 '25 04:01 kylebarron