geo-index
geo-index copied to clipboard
RTree searches: return iterator for nearest neighbor search
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.