-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
[Docs] Problems with using geocentroid for multi-valued geo_points #49189
Comments
Pinging @elastic/es-analytics-geo (:Analytics/Geo) |
Pinging @elastic/es-docs (>docs) |
@EmilBode adding some warning to the docs looks like a good first step. Since you already added a suggestion, maybe you are interested in opening a PR for it? The team can then discuss any changes they'd like there. Let us know if you are interested and need directions. Otherwise no problem, thanks for raising the issue anyway. |
Hi Cristoph,
Thanks for asking, but I'm not sure whether me managing the PR would add
much value, and also not really sure if I can commit to making time for it.
So I'll let you solve this without my help.
Kind regards, Emil Bode
…On Tue, Nov 19, 2019 at 12:39 PM Christoph Büscher ***@***.***> wrote:
@EmilBode <https://github.com/EmilBode> adding some warning to the docs
looks like a good first step. Since you already added a suggestion, maybe
you are interested in opening a PR for it? The team can then discuss any
changes they'd like there. Let us know if you are interested and need
directions. Otherwise no problem, thanks for raising the issue anyway.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#49189?email_source=notifications&email_token=AFN6P72DKE5VOWVFPD5FHKDQUPF55A5CNFSM4JN6BCHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEN4PUI#issuecomment-555468753>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFN6P74KPH2AK6SUTZMA2QTQUPF55ANCNFSM4JN6BCHA>
.
|
Describe the feature:
Some elastic behaviour bit me, I think a warning in the documentation would be fair:
When making a geohash, elastic aggregates different documents into buckets, not the individual
geo_points
This means that a bucket can contain a document with points both inside and outside this bucket. Now when calculating the gecentroid, all points are considered, also those outside of the bucket boundary.
Consider this example:
The result gives us 2 buckets, both with the same geo_centroid at longitude 45.
The same happens when making a coordinate map in Kibana, although luckily Kibana is smart enough to not allow the point to be drawn outside of the box. However, it's clearly visible that our (0,0) point is drawn eastwards and our (0, 90) points dragged westwards.
A workaround could be to make the geo_points nested documents, and use a nested aggregation, but that doesn't work with Kibana.
The very best solution would obviously be to have the geo_centroid only consider those point that are actually inside the bucket, but I don't think that's feasible.
But for now, I think the documentation about this could be clearer.
My suggestion: We could add a warning on https://www.elastic.co/guide/en/elasticsearch/reference/7.4/search-aggregations-metrics-geocentroid-aggregation.html (and the pages for other version), like this:
Warning: When you have multi-valued geo_point-fields, geo_centroid calculates the centroid of all those fields in selected documents. This means that using a geo_centroid in a geohash-aggregation can cause the centroid to be (far) out of the boundaries of your bucket
Elasticsearch version: 7.3.1
JVM version: 1.8.0_231
OS version: Windows 10
I've also filed an issue at Kibana, elastic/kibana#50799
The text was updated successfully, but these errors were encountered: