# Implementations of Spatial Indices

**URL:** <https://discourse.julialang.org/t/implementations-of-spatial-indices/7638>\
**Category:** Geo\
**Created:** [December 8, 2017, 10:54pm UTC](https://discourse.julialang.org/t/implementations-of-spatial-indices/7638 "2017-12-08T22:54:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![yeesian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yeesian/32/652_2.png) [@yeesian](https://discourse.julialang.org/u/yeesian)\
**Post date:** [December 8, 2017, 10:54pm UTC](https://discourse.julialang.org/t/implementations-of-spatial-indices/7638/1 "2017-12-08T22:54:25Z")

</div>

Is there anything along the lines of [https://github.com/libspatialindex/libspatialindex](https://github.com/libspatialindex/libspatialindex) in julia?

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [December 9, 2017, 7:32am UTC](https://discourse.julialang.org/t/implementations-of-spatial-indices/7638/2 "2017-12-09T07:32:10Z")

</div>

What specific functionality are you looking for?

---

<div class="post-metadata">

**Author:** ![yeesian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yeesian/32/652_2.png) [@yeesian](https://discourse.julialang.org/u/yeesian)\
**Post date:** [December 9, 2017, 5:09pm UTC](https://discourse.julialang.org/t/implementations-of-spatial-indices/7638/3 "2017-12-09T17:09:03Z")

</div>

I’m looking for a [R-tree](https://en.wikipedia.org/wiki/R-tree) implementation similar to [GitHub - KristofferC/NearestNeighbors.jl: High performance nearest neighbor data structures and algorithms for Julia.](https://github.com/KristofferC/NearestNeighbors.jl)

**Update** : Ah, I see there’s an [GitHub - BioJulia/IntervalTrees.jl: A data structure for efficient manipulation of sets of intervals](https://github.com/BioJulia/IntervalTrees.jl) package, except I’m interested in 2-3 dimensions

---

<div class="post-metadata">

**Author:** ![yeesian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yeesian/32/652_2.png) [@yeesian](https://discourse.julialang.org/u/yeesian)\
**Post date:** [December 9, 2017, 6:21pm UTC](https://discourse.julialang.org/t/implementations-of-spatial-indices/7638/4 "2017-12-09T18:21:12Z")

</div>

@visr @fabiangans may I trouble either of you to run Clang.jl on [libspatialindex’s C API](https://github.com/libspatialindex/libspatialindex/tree/master/include/spatialindex/capi)?

---

<div class="post-metadata">

**Author:** ![yeesian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yeesian/32/652_2.png) [@yeesian](https://discourse.julialang.org/u/yeesian)\
**Post date:** [December 9, 2017, 7:40pm UTC](https://discourse.julialang.org/t/implementations-of-spatial-indices/7638/5 "2017-12-09T19:40:00Z")

</div>

Work-In-Progress: [https://github.com/yeesian/LibSpatialIndex.jl](https://github.com/yeesian/LibSpatialIndex.jl)

---

<div class="post-metadata">

**Author:** ![visr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/visr/32/17204_2.png) [@visr](https://discourse.julialang.org/u/visr)\
**Post date:** [December 10, 2017, 8:25pm UTC](https://discourse.julialang.org/t/implementations-of-spatial-indices/7638/6 "2017-12-10T20:25:35Z")

</div>

Great, I see you already got it running. Will be a nice addition. Would also be fun to implement some more of these in Julia, see this blog post:

> **[A dive into spatial search algorithms](https://blog.mapbox.com/a-dive-into-spatial-search-algorithms-ebd0c5e39d2a)**
>
> Searching through millions of points in an instant

And the authors JS package for R-trees, [GitHub - mourner/rbush: RBush — a high-performance JavaScript R-tree-based 2D spatial index for points and rectangles](https://github.com/mourner/rbush)

---

<div class="post-metadata">

**Author:** ![yeesian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yeesian/32/652_2.png) [@yeesian](https://discourse.julialang.org/u/yeesian)\
**Post date:** [December 11, 2017, 4:11pm UTC](https://discourse.julialang.org/t/implementations-of-spatial-indices/7638/7 "2017-12-11T16:11:54Z")

</div>

For people in search of alternative implementations for spatial indices, I was just made aware of a few other options by @evetion (on the slack channel):

- [RegionTrees.jl](https://github.com/rdeits/RegionTrees.jl) for [QuadTrees](https://en.wikipedia.org/wiki/Quadtree) which is a popular choice for point cloud data
- [LASIndex.jl](https://github.com/evetion/LASindex.jl) which reads `.lax` files into a quadtree from the RegionTrees package.

---

<div class="post-metadata">

**Author:** ![alyst](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alyst/32/18855_2.png) [@alyst](https://discourse.julialang.org/u/alyst)\
**Post date:** [November 22, 2018, 3:43pm UTC](https://discourse.julialang.org/t/implementations-of-spatial-indices/7638/8 "2018-11-22T15:43:20Z")

</div>

FYI, I’ve just started [SpatialIndexing.jl](https://github.com/alyst/SpatialIndexing.jl). Currently there’s pure Julia implementation of R-tree (different flavors including R\*-tree). It’s already working (insertion, deletion, bulk loading), but the API is not stabilized (and the query API is not implemented yet).
