Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geo:Valid Polygon crossing dateline fails to parse #6179

Closed
marcuswr opened this issue May 14, 2014 · 0 comments
Closed

Geo:Valid Polygon crossing dateline fails to parse #6179

marcuswr opened this issue May 14, 2014 · 0 comments

Comments

@marcuswr
Copy link

Attempt to upload polygon at https://gist.github.com/anonymous/7f1bb6d7e9cd72f5977c
fails with
org.elasticsearch.index.mapper.MapperParsingException: failed to parse [geometry]
...
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1

Repro

curl -XDELETE 'http://localhost:9200/test'

curl -XPOST 'http://localhost:9200/test' -d '{
"mappings":{
"test":{
"properties":{
"geometry":{
"type":"geo_shape",
"tree":"quadtree",
"tree_levels":14,
"distance_error_pct":0.0
}
}
}
}
}'

curl -XPOST 'http://localhost:9200/test/test/1' -d '{
"geometry": {
"type": "Polygon",
"coordinates": [[[-186,0],[-176,0],[-176,3],[-183,3],[-183,5],[-176,5],[-176,8],[-186,8],[-186,0]],[[-185,1],[-181,1],[-181,2],[-184,2],[-184,6],[-178,6],[-178,7],[-185,7],[-185,1]],[[-179,1],[-177,1],[-177,2],[-179,2],[-179,1]],[[-180,0],[-180,-90],[-180,90],[-180,0]]]
}
}'

Additionally, there is a unit test at:
marcuswr/elasticsearch-dateline@cbf9db1

@colings86 colings86 self-assigned this May 22, 2014
@colings86 colings86 changed the title Valid Polygon crossing dateline fails to parse Geo:Valid Polygon crossing dateline fails to parse May 27, 2014
colings86 added a commit that referenced this issue Jun 2, 2014
If a polygon is constructed which overlaps the date line but has a hole which lies entirely one to one side of the date line, JTS error saying that the hole is not within the bounds of the polygon because the code which splits the polygon either side of the date line does not add the hole to the correct component of the final set of polygons.  The fix ensures this selection happens correctly.

Closes #6179
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants