# KDTree in NearestNeighbors.jl with Rectangles as leaf nodes

**URL:** <https://discourse.julialang.org/t/kdtree-in-nearestneighbors-jl-with-rectangles-as-leaf-nodes/22369>\
**Category:** Specific Domains\
**Created:** [March 26, 2019, 7:02pm UTC](https://discourse.julialang.org/t/kdtree-in-nearestneighbors-jl-with-rectangles-as-leaf-nodes/22369 "2019-03-26T19:02:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sambitdash](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sambitdash/32/1377_2.png) [@sambitdash](https://discourse.julialang.org/u/sambitdash)\
**Post date:** [March 26, 2019, 7:02pm UTC](https://discourse.julialang.org/t/kdtree-in-nearestneighbors-jl-with-rectangles-as-leaf-nodes/22369/1 "2019-03-26T19:02:51Z")

</div>

Hi All,

I have a few hundreds of rectangles on which I want to conduct `knn` search. The `KDTree` being ideal data structure for me. I am not able find an interface that can take `HyperRectangle` as input. Is there any interface available for the same?

Otherwise, if there is a `RTree` implementation planned that will be helpful as well.

regards,

Sambit

---

<div class="post-metadata">

**Author:** ![cserteGT3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/csertegt3/32/8283_2.png) [@cserteGT3](https://discourse.julialang.org/u/cserteGT3)\
**Post date:** [March 26, 2019, 8:04pm UTC](https://discourse.julialang.org/t/kdtree-in-nearestneighbors-jl-with-rectangles-as-leaf-nodes/22369/2 "2019-03-26T20:04:30Z")

</div>

You should check [RegionTrees.jl](https://github.com/rdeits/RegionTrees.jl). It’s maybe what you’re looking for.
