# Spatial join with dataframes

**URL:** <https://discourse.julialang.org/t/spatial-join-with-dataframes/93241>\
**Category:** General Usage\
**Tags:** dataframes, geo\
**Created:** [January 20, 2023, 1:07am UTC](https://discourse.julialang.org/t/spatial-join-with-dataframes/93241 "2023-01-20T01:07:03Z")\
**Posts on this page:** 1\
**Showing post:** 23

<div class="post-metadata">

**Author:** ![rocco\_sprmnt21](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rocco_sprmnt21/32/20127_2.png) [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Post date:** [January 25, 2023, 9:24pm UTC](https://discourse.julialang.org/t/spatial-join-with-dataframes/93241/23 "2023-01-25T21:24:32Z")

</div>

> [@evetion](#):
>
> Ah, I indeed didn’t fully understand your question. I took it as a suggestion for spatial intersections/geometry, and I suggested more. I think these can’t do this spatial join themselves, but they can be a provider for the predicate function in a naive, non-optimized (n^2) way. The only fast way is doing spatial indexing, which is essentially an optimized version of the boundingbox approach by [Dan](https://discourse.julialang.org/t/spatial-join-with-dataframes/93241/10) later in this topic.

Yes sure. In my idea the linked scripts were potentially usable as a predicate from flexijoins.  
In this sense I was addressing @aplavin , who asked for the use of efficient spatial search algorithms to be employed within flexijoins  
In particular, in my quick reading, [this part](https://discourse.julialang.org/t/efficiently-check-if-points-are-contained-in-polygons/74415/8) seemed more interesting to me, which is perhaps better than O(n^2).

“GMT.jl can do this pretty quickly. When one reads a shape file (or other OGR formats) we get a vector of GMTdataset that has, among others, a boundingbox field for each polygon. So we can do the quick scan through to see if points are, or not, inside each of the polygon’s BB and if yes than use the `gmtselect` module that gets us the point-in-polygon answer.”

---

_[View the full topic](https://discourse.julialang.org/t/spatial-join-with-dataframes/93241)._
