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

Add geo_shape support to geo_centroid aggregation #46299

Merged
merged 2 commits into from
Sep 10, 2019

Conversation

talevy
Copy link
Contributor

@talevy talevy commented Sep 3, 2019

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

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.
@talevy talevy added the :Analytics/Geo Indexing, search aggregations of geo points and shapes label Sep 3, 2019
@talevy talevy requested a review from imotov September 3, 2019 21:16
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo

Copy link
Contributor

@imotov imotov left a 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.

Copy link
Contributor

@polyfractal polyfractal left a 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!

@talevy
Copy link
Contributor Author

talevy commented Sep 10, 2019

thanks all!

@talevy talevy merged commit 741a456 into elastic:geoshape-doc-values Sep 10, 2019
@talevy talevy deleted the gdv-centroid branch September 10, 2019 19:20
talevy added a commit that referenced this pull request Sep 20, 2019
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants