When inserting a large polygon near the south pole:
"polygon":{
"type":"polygon",
"coordinates":[
[
[
-134.97410583496094,
-61.81480026245117
],
[
-130.1757049560547,
-63.236000061035156
],
[
-125.17160034179688,
-64.40799713134766
],
[
-152.0446014404297,
-75.72830200195312
],
[
143.52340698242188,
-77.68319702148438
],
[
147.41830444335938,
-75.44519805908203
],
[
150.2816925048828,
-73.01909637451172
],
[
-162.17909240722656,
-71.5260009765625
],
[
-134.97410583496094,
-61.81480026245117
]
]
]
},
, the following error is returned.
{
"error" : "RemoteTransportException[[ISAAC][inet[/x.x.x.x:9300]][indices:data/write/index]]; nested: MapperParsingException[failed to parse [polygon]]; nested: InvalidShapeException[Self- intersection at or near point (-142.29442281263474, -71.62101996804898, NaN)]; ",
"status" : 400
}
The mapping of the type is:
curl -XPUT http://localhost:9200/files/_mapping/polar -d '
{ "polar" : { "properties" : { "startTimeRange" : { "type" : "date"}, "endTimeRange" : { "type" : "date"}, "productShortName" : { "type": "string", "index" : "not_analyzed" }, "polygon" : { "type" : "geo_shape", "tree" : "quadtree", "precision" : "1000m" } } } } '
The intended shape is essential a rectangle crossing the dateline (anti-meridian).
It looks like the shape is being interpreted as a self-intersecting polygon crossing the meridian (0 - Longitude).
What is the best way to represent the intended shape in elasticsearch?