# "invalid\_shape\_exception: Y values \[127.03280083907562 to 127.0164930082651\] not in boundary Rect(minX=-180.0,maxX=180.0,minY=-90.0,maxY=90.0)"

**URL:** <https://discuss.elastic.co/t/invalid-shape-exception-y-values-127-03280083907562-to-127-0164930082651-not-in-boundary-rect-minx-180-0-maxx-180-0-miny-90-0-maxy-90-0/198612>\
**Category:** Elasticsearch\
**Created:** [September 9, 2019, 6:42am UTC](https://discuss.elastic.co/t/invalid-shape-exception-y-values-127-03280083907562-to-127-0164930082651-not-in-boundary-rect-minx-180-0-maxx-180-0-miny-90-0-maxy-90-0/198612 "2019-09-09T06:42:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ohoroyoi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ohoroyoi/32/46820_2.png) [@ohoroyoi](https://discuss.elastic.co/u/ohoroyoi)\
**Post date:** [September 9, 2019, 6:42am UTC](https://discuss.elastic.co/t/invalid-shape-exception-y-values-127-03280083907562-to-127-0164930082651-not-in-boundary-rect-minx-180-0-maxx-180-0-miny-90-0-maxy-90-0/198612/1 "2019-09-09T06:42:27Z")

</div>

I want to gather regions within specific area.

curl -X GET "[https://atlas-search.test.com/regions\_19090403/\_search?pretty](https://atlas-search.test.com/regions_19090403/_search?pretty)" -H 'Content-Type: application/json' -d'  
{  
"query":{  
"bool": {  
"must": {  
"match\_all": {}  
},  
"filter": {  
"geo\_shape": {  
"boundaries": {  
"shape": {  
"type": "envelope",  
"coordinates" : [[37.54069137885601, 127.0164930082651], [37.472603386664225, 127.03280083907562]]  
},  
"relation": "within"  
}  
}  
}  
}  
}  
}  
'

but it returns

caused\_by" : {  
"type" : "invalid\_shape\_exception",  
"reason" : "invalid\_shape\_exception: Y values [127.03280083907562 to 127.0164930082651] not in boundary Rect(minX=-180.0,maxX=180.0,minY=-90.0,maxY=90.0)"

and I can't know why.

---

<div class="post-metadata">

**Author:** ![Ignacio\_Vera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ignacio_vera/32/36674_2.png) [@Ignacio\_Vera](https://discuss.elastic.co/u/Ignacio_Vera)\
**Post date:** [September 9, 2019, 7:09am UTC](https://discuss.elastic.co/t/invalid-shape-exception-y-values-127-03280083907562-to-127-0164930082651-not-in-boundary-rect-minx-180-0-maxx-180-0-miny-90-0-maxy-90-0/198612/2 "2019-09-09T07:09:44Z")

</div>

Coordinates of an envelope needs to be declared as [[minLon, maxLat], [maxLon, minLat]]

[https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-shape.html#\_envelope](https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-shape.html#_envelope)

---

<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:** [October 7, 2019, 7:18am UTC](https://discuss.elastic.co/t/invalid-shape-exception-y-values-127-03280083907562-to-127-0164930082651-not-in-boundary-rect-minx-180-0-maxx-180-0-miny-90-0-maxy-90-0/198612/3 "2019-10-07T07:18:16Z")

</div>

Closed on October 7, 2019, 7:18am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
