-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
Elasticsearch version (bin/elasticsearch --version): 6.1.2
Plugins installed: []
JVM version (java -version): 1.8.0_151
OS version (uname -a if on a Unix-like system): Windows 10
Description of the problem including expected versus actual behavior: I am trying to index a polygon with a hole. Normally this works, but with a particular set of points it keeps failing with the following error:
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "failed to parse [location]"
}
],
"type": "mapper_parsing_exception",
"reason": "failed to parse [location]",
"caused_by": {
"type": "array_index_out_of_bounds_exception",
"reason": "-1"
}
},
"status": 400
}
Steps to reproduce:
I am using the following mapping:
PUT /regions
{
"mappings": {
"region": {
"properties": {
"name": {
"type": "string"
},
"location": {
"type": "geo_shape"
}
}
}
}
}
Attempting to index this polygon with hole results in the aforementioned error:
PUT /regions/region/overlap7
{
"name" : "Overlap7",
"location" : {
"type" : "polygon",
"coordinates" : [
[
[ -111.92674,33.53625 ],
[ -112.40224,43.33018 ],
[ -91.54212,43.35777 ],
[ -90.41345,32.98592 ],
[ -111.92674,33.53625 ]
],
[
[ -109.07029,31.49836 ],
[ -108.97451,36.95538 ],
[ -102.77015,37.161 ],
[ -103.15759,31.9478 ],
[ -109.07029,31.49836 ]
]
]
}
}
I ran the JSON in a validator to confirm that it's fine.
Indexing the main polygon alone works:
PUT /regions/region/overlap8
{
"name" : "Overlap8",
"location" : {
"type" : "polygon",
"coordinates" : [
[
[ -111.92674,33.53625 ],
[ -112.40224,43.33018 ],
[ -91.54212,43.35777 ],
[ -90.41345,32.98592 ],
[ -111.92674,33.53625 ]
]
]
}
}
Indexing the hole alone works:
PUT /regions/region/overlap9
{
"name" : "Overlap9",
"location" : {
"type" : "polygon",
"coordinates" : [
[
[ -109.07029,31.49836 ],
[ -108.97451,36.95538 ],
[ -102.77015,37.161 ],
[ -103.15759,31.9478 ],
[ -109.07029,31.49836 ]
]
]
}
}
Indexing a polygon with hole in a completely different area works:
PUT /regions/region/overlap12
{
"name" : "Overlap12",
"location" : {
"type" : "polygon",
"coordinates" : [
[
[ 141.04445,-28.92704 ],
[ 141.00841,-33.97411 ],
[ 149.94544,-37.51381 ],
[ 150.7789, -34.98252 ],
[ 152.18365,-32.70393 ],
[ 153.49901,-28.24141 ],
[ 148.87874,-28.98426 ],
[ 141.04445,-28.92704 ]
],
[
[ 149.05898,-35.91185 ],
[ 149.14473,-35.36119 ],
[ 149.40076,-35.31932 ],
[ 149.09984,-35.11429 ],
[ 149.05898,-35.91185 ]
]
]
}
}
I don't see what I'm doing different here from the failing case, so please call out if there's some really tiny mistake that I'm missing.