"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)"

I want to gather regions within specific area.

curl -X GET "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.

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

1 Like

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