-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Add geo_shape support to geo_centroid aggregation #46299
Conversation
This commit annotates geometries with centroid information at index-time. Then each shapes centroid is used as input to the geo_centroid aggregator so that it effectively calculates the centroid of centroids of shapes within each bucket. The centroid of each geo_shape field is calculated as the centroid of all the points of all the shapes in the geometry collection. The centroid of each shape is calculated the same way geo_centroid was -- using a kahan-summation to reduce precision loss.
Pinging @elastic/es-analytics-geo |
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.
Sorry for the delay. LGTM. I think it might be good for @polyfractal to take a look at it as well from aggregations perspective.
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.
Agg-specific stuff LGTM. It's notable how little actually changed on the agg side (some generics basically), good work!
thanks all! |
* Add geo_shape support to geo_centroid aggregation This commit annotates geometries with centroid information at index-time. Then each shapes centroid is used as input to the geo_centroid aggregator so that it effectively calculates the centroid of centroids of shapes within each bucket. The centroid of each geo_shape field is calculated as the centroid of all the points of all the shapes in the geometry collection. The centroid of each shape is calculated the same way geo_centroid was -- using a kahan-summation to reduce precision loss. * add centroid test
This commit annotates geometries with centroid information
at index-time. Then each shapes centroid is used as input to
the geo_centroid aggregator so that it effectively calculates
the centroid of centroids of shapes within each bucket.
The centroid of each geo_shape field is calculated as the
centroid of all the points of all the shapes in the geometry
collection.
The centroid of each shape is calculated the same way geo_centroid
was -- using a kahan-summation to reduce precision loss.
relates to #37206