-
Notifications
You must be signed in to change notification settings - Fork 25.2k
CentroidCalculator needs protection against very small polygons #52774
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
Labels
:Analytics/Geo
Indexing, search aggregations of geo points and shapes
Comments
Pinging @elastic/es-analytics-geo (:Analytics/Geo) |
I'll dig into this, the problem seems to be when a triangle in a polygon has zero weight, its centroid degrades to infinity. for example, the second polygon you shared has a total ring area of |
talevy
added a commit
to talevy/elasticsearch
that referenced
this issue
Feb 25, 2020
there are times where small triangle areas within a polygon have really small areas 1e-11, while the whole polygon's area is zero. This results in an infinite valuation of the centroid point representing that triangle. This commit ignores the addition of such values Addresses elastic#52774
talevy
added a commit
that referenced
this issue
Feb 26, 2020
there are times where small triangle areas within a polygon have really small areas 1e-11, while the whole polygon's area is zero. This results in an infinite valuation of the centroid point representing that triangle. This commit ignores the addition of such values Addresses #52774
Fixed in #52782 |
talevy
added a commit
that referenced
this issue
Feb 26, 2020
there are times where small triangle areas within a polygon have really small areas 1e-11, while the whole polygon's area is zero. This results in an infinite valuation of the centroid point representing that triangle. This commit ignores the addition of such values Addresses #52774
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was working with one of my datasets on the geoshape doc values branch and some of the documents are now eroding out when indexing. After having a closer look, this polygons are very small (probably lines) and they only have four points. for example:
Although they can be more complicated and the problematic polygon is a hole:
The issue is that when calculating the area, this value is zero and makes the centroid calculator to generate NaN for the coordinates which errors out when trying to serialise it.
cc @talevy
The text was updated successfully, but these errors were encountered: