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

Correct ShapeBuilder coordinate parser to ignore values in 3rd+ dimension #10539

Merged
merged 1 commit into from Apr 10, 2015

Conversation

Projects
None yet
3 participants
@nknize
Member

nknize commented Apr 10, 2015

ShapeBuilder's coordinate parser expected 2 double values for every coordinate array. If > 2 doubles were provided the parser terminated parsing of the coordinate array. This resulted in an invalid Shape state leaving LineStrings, LinearRings, and Polygons with a single coordinate. An incorrect parse exception was thrown. This corrects the parser to ignore those values in the 3rd+ dimension, correctly parsing the rest of the coordinate array. Unit tests have been updated to verify the fix.

closes #10510

[GEO] Correct ShapeBuilder coordinate parser to ignore values in 3rd+…
… dimension

ShapeBuilder's coordinate parser expected 2 double values for every coordinate array. If > 2 doubles were provided the parser terminated parsing of the coordinate array. This resulted in an invalid Shape state leaving LineStrings, LinearRings, and Polygons with a single coordinate. An incorrect parse exception was thrown. This corrects the parser to ignore those values in the 3rd+ dimension, correctly parsing the rest of the coordinate array.

Unit tests have been updated to verify the fix.

closes #10510

@nknize nknize merged commit 90e1775 into elastic:master Apr 10, 2015

1 check passed

CLA Commit author is a member of Elasticsearch
Details
@colings86

This comment has been minimized.

Show comment
Hide comment
@colings86

colings86 Apr 20, 2015

Member

We should add this change to the breaking changes doc since it is a change of behaviour. IMO we should have an option in the mapping to decide whether to error on extra dimensions or not and should default to erroring so it is explicit that our geo implementaiton only actually supports 2 dimensions

Member

colings86 commented Apr 20, 2015

We should add this change to the breaking changes doc since it is a change of behaviour. IMO we should have an option in the mapping to decide whether to error on extra dimensions or not and should default to erroring so it is explicit that our geo implementaiton only actually supports 2 dimensions

@nknize nknize removed the review label Apr 21, 2015

@clintongormley clintongormley changed the title from [GEO] Correct ShapeBuilder coordinate parser to ignore values in 3rd+ dimension to Correct ShapeBuilder coordinate parser to ignore values in 3rd+ dimension May 29, 2015

@nknize nknize deleted the nknize:fix/10510 branch May 27, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment