-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add Z value support to geo_point and geo_shape #25738
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to add a version check here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to add a version check here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should test parsing too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added testParse3DPolygon to GeoJSONShapeParserTests
6182333 to
bc29b96
Compare
bc29b96 to
a2118c1
Compare
|
@hanoch This PR effectively fixes a bug where Z values for |
52ee020 to
fdf07e0
Compare
fdf07e0 to
d9383f3
Compare
|
@nknize are you still working on this? |
|
@nknize we are still waiting for this functionality to be merged into the master branch. |
|
cc: @sherry-ger |
1744096 to
0a7868d
Compare
|
@colings86 This should be good to go. Could you give it a final once over since @jpountz is out? Thx |
|
Discussed this in FixItFriday. We're not crazy about accepting parameters that we will silently ignore, but given that Z values are part of the geojson spec, we should probably make an effort to extract what info we can from valid geojson files. It should, however, be enabled by opting in using a mapping parameter like |
colings86
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nknize this looks ok to me but could you add the option that @clintongormley mentioned and a tests with 3 dimensional polygons with and without that setting?
0a7868d to
300fde3
Compare
|
are we finally ready to merge this to master anytime soon? |
|
@colings86 @jpountz @nknize is this now ready to be merged to master to be able to address #22917? |
7e215b5 to
e473d77
Compare
|
Rebased to master and cleaned up some geo_point parsing. This is ready for another review and should be just about ready to merge. /cc @jpountz @colings86 |
colings86
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, its a shame the changes are so pervasive in the code and the acceptZValue option has to be passed around so much but unfortunately I don't think there is a better way to do it.
jpountz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the docs very explicit about how the 3rd dimension is handled. I left some comments but it looks like it is on the right track to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beware it might not do what you think: https://stackoverflow.com/questions/8819738/why-does-double-nan-double-nan-return-false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, yes... thank you. I still slip up w/ this one occasionally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the expected number of dims and the new coordinate to the error message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't seem to be making decisions based on this option? or do I miss it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should it be called something like ignore_z_value instead to make it clear it's ignored?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reading the rest of the PR, it doesn't seem like we really need this method? We could just check whether the string contains a comma to know whether it is a geohash and then use the length of the array after splitting to know the number of dimensions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for this alt variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be version 6.3 now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be 6.3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove todo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true by default? shouldn't it be false like the docs say? (we might need some logic to make it true for pre-6.3 indices in case we used to accept it in the past)
jpountz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logic looks good to me overall. I think we should make the default of ignore_z_value false as it could otherwise be a bit trappy? For shapes we can do it directly in this PR since they never supported 3 dimensions (if my understanding is correct). And for points which were always lenient until now (again, if my understanding is correct), we would make the default true in this PR (like you did) but do a follow-up PR to change the default to false on 7.0+ indices
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fail if vals.length > 3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/ACCEPT/IGNORE/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove this leniency?
|
@jpountz @nknize what is the overall design goal wrt the default behavior with Z values with geo_shape and geo_point? |
|
@hanoch we do not want the Z Values to be accepted by default because it can be surprising to users. The fact that the z value is accepted but is not indexed and therefore does not affect search results is not what a user would expect OOTB so we feel it is a better user experience for the user to opt-in to accepting but ignoring the Z-Value. |
|
is there anything else pending or are we ready to merge this PR? |
05cc21a to
59c65a6
Compare
This enhancement adds Z value support (source only) to geo_shape fields. If vertices are provided with a third dimension, the third dimension is ignored for indexing but returned as part of source. Like beofre, any values greater than the 3rd dimension are ignored. closes elastic#23747
59c65a6 to
fede633
Compare

This enhancement adds Z value support (source only) to geo_shape fields. If vertices are provided with a third dimension, the third dimension is ignored for indexing but returned as part of source. Like before, any values greater than the 3rd dimension are ignored.
closes #22917