# GeoSearch against stored Bounding Box

**URL:** <https://discuss.elastic.co/t/geosearch-against-stored-bounding-box/6801>\
**Category:** Elasticsearch\
**Created:** [February 24, 2012, 4:05pm UTC](https://discuss.elastic.co/t/geosearch-against-stored-bounding-box/6801 "2012-02-24T16:05:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ian\_mayo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ian_mayo/32/2324_2.png) [@ian\_mayo](https://discuss.elastic.co/u/ian_mayo)\
**Post date:** [February 24, 2012, 4:05pm UTC](https://discuss.elastic.co/t/geosearch-against-stored-bounding-box/6801/1 "2012-02-24T16:05:23Z")

</div>

Hi,  
all I've been through the query/filter documentation, and have seen  
the ability to search for points in a bounding box.

My domain problem is subtlely different. I am storing bounding boxes,  
and want to find the box that contains the search point.

Storing the 4 corners of the box and searching against them won't give  
me my answer: that would return a distance - and I can't determine yes/  
no bounds from that.

I guess the same situation would apply to stored polygons. If we have  
the world's countries stored as polygons we may want to find the  
country that contains a particular lat/long. Or we may have a  
database of aerial imagery, and we may want to find any images that  
cover a particular lat/long.

Most grateful for any clarification on this,  
Cheers,  
Ian

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [February 26, 2012, 7:32pm UTC](https://discuss.elastic.co/t/geosearch-against-stored-bounding-box/6801/2 "2012-02-26T19:32:32Z")

</div>

There isn't support for matching on stored bounding boxes. It has been discussed in the mailing list before, it will require adding a new type of filter, which expects to get the locations for the bounding box fields, and then do the checks.

On Friday, February 24, 2012 at 6:05 PM, ian mayo wrote:

> Hi,  
> all I've been through the query/filter documentation, and have seen  
> the ability to search for points in a bounding box.
> 
> My domain problem is subtlely different. I am storing bounding boxes,  
> and want to find the box that contains the search point.
> 
> Storing the 4 corners of the box and searching against them won't give  
> me my answer: that would return a distance - and I can't determine yes/  
> no bounds from that.
> 
> I guess the same situation would apply to stored polygons. If we have  
> the world's countries stored as polygons we may want to find the  
> country that contains a particular lat/long. Or we may have a  
> database of aerial imagery, and we may want to find any images that  
> cover a particular lat/long.
> 
> Most grateful for any clarification on this,  
> Cheers,  
> Ian

---

<div class="post-metadata">

**Author:** ![ian\_mayo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ian_mayo/32/2324_2.png) [@ian\_mayo](https://discuss.elastic.co/u/ian_mayo)\
**Post date:** [February 27, 2012, 9:33am UTC](https://discuss.elastic.co/t/geosearch-against-stored-bounding-box/6801/3 "2012-02-27T09:33:29Z")

</div>

New issue (feature request) added to GitHub  
cheers Shay,  
Ian

On Feb 26, 7:32 pm, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:

> There isn't support for matching on stored bounding boxes. It has been discussed in the mailing list before, it will require adding a new type of filter, which expects to get the locations for the bounding box fields, and then do the checks.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:38am UTC](https://discuss.elastic.co/t/geosearch-against-stored-bounding-box/6801/4 "2017-07-06T03:38:06Z")

</div>


