# Geo\_point and geo\_bounding\_box

**URL:** <https://discuss.elastic.co/t/geo-point-and-geo-bounding-box/37060>\
**Category:** Elasticsearch\
**Created:** [December 13, 2015, 1:55pm UTC](https://discuss.elastic.co/t/geo-point-and-geo-bounding-box/37060 "2015-12-13T13:55:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jcl/32/6605_2.png) [@jcl](https://discuss.elastic.co/u/jcl)\
**Post date:** [December 13, 2015, 1:55pm UTC](https://discuss.elastic.co/t/geo-point-and-geo-bounding-box/37060/1 "2015-12-13T13:55:55Z")

</div>

##Hi all,

have a problem with elasticsearch 2.1 and geo\_bounding\_box.

My ES configuration (docker image) :

```auto
version: {
number: "2.1.0",
build_hash: "72cd1f1a3eee09505e036106146dc1949dc5dc87",
build_timestamp: "2015-11-18T22:40:03Z",
build_snapshot: false,
lucene_version: "5.3.1"
},

```

I set up the mappings :

````auto
properties: {
  name: {
    type: "string"
  },
  pin: {
    type: "geo_point"
  }
}
```

Pins are stored correctly :

````

\_source: {  
name: "this is a name",  
[...]  
pin: {  
lat: 50.5757616,  
lon: 3.0771416  
}  
}

```auto

When i execute the following query :

```

[{"query":{"bool":{"must":{"match\_all":{}},"filter":{"geo\_bounding\_box":{"location":{"top\_left":{"lat":50.5641649,"lon":3.095948},"bottom\_right":{"lat":50.5819679,"lon":3.064912}}}}}}}]];

```auto

I have no results.

Seems like "geo_boundnig_box" is bugging... Indeed with a "geo_distance" filter I get 1 result...

Any tips ?

Thanks
```

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [December 14, 2015, 9:39am UTC](https://discuss.elastic.co/t/geo-point-and-geo-bounding-box/37060/2 "2015-12-14T09:39:12Z")

</div>

It looks like your `bottom_right` point is to the left of your `top_left` point. This means that instead of your bounding box being a small square in the north of France, it will be a short but very wide rectangle stretching most of the way around the world. I am also noticing that there is the same issue for the top and bottom latitudes, the bottom latitude is above the top latitude. Try swapping the `top_left` and `bottom_right` coordinates in your query

---

<div class="post-metadata">

**Author:** ![jcl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jcl/32/6605_2.png) [@jcl](https://discuss.elastic.co/u/jcl)\
**Post date:** [December 14, 2015, 5:32pm UTC](https://discuss.elastic.co/t/geo-point-and-geo-bounding-box/37060/3 "2015-12-14T17:32:51Z")

</div>

@colings86 you're right the problem was in my Geocoder i switch northwest and southeast 😉

Seems I was too focused on elasticsearch.

Thanks !

---

<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 5, 2017, 11:31pm UTC](https://discuss.elastic.co/t/geo-point-and-geo-bounding-box/37060/4 "2017-07-05T23:31:14Z")

</div>


