Skip to content

Conversation

iverase
Copy link
Contributor

@iverase iverase commented Sep 22, 2025

Very small polygons with holes can compute negative weights die to rounding errors. This will break our serialisation logic as we expect numbers greater or equal to zero. In order to avoid this, we will return a weight of zero if the summation weight gets resolved to a negative value.

fixes #131861

@iverase iverase added >bug :Analytics/Geo Indexing, search aggregations of geo points and shapes v9.2.0 v8.17.11 v9.1.5 labels Sep 22, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Sep 22, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine
Copy link
Collaborator

Hi @iverase, I've created a changelog YAML for you.

Copy link
Contributor

@craigtaverner craigtaverner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@iverase iverase added v8.19.5 v9.0.8 auto-backport Automatically create backport pull requests when merged and removed v8.17.11 labels Sep 22, 2025
@iverase iverase merged commit 8dea443 into elastic:main Sep 22, 2025
34 checks passed
@iverase iverase deleted the centroidWeight branch September 22, 2025 12:20
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.19
9.1
9.0

iverase added a commit to iverase/elasticsearch that referenced this pull request Sep 22, 2025
…c#135176)

Small polygons with holes can compute negative weights due to rounding errors and break 
serialization for those geometries.
iverase added a commit to iverase/elasticsearch that referenced this pull request Sep 22, 2025
…c#135176)

Small polygons with holes can compute negative weights due to rounding errors and break 
serialization for those geometries.
iverase added a commit to iverase/elasticsearch that referenced this pull request Sep 22, 2025
…c#135176)

Small polygons with holes can compute negative weights due to rounding errors and break 
serialization for those geometries.
elasticsearchmachine pushed a commit that referenced this pull request Sep 22, 2025
… (#135188)

Small polygons with holes can compute negative weights due to rounding errors and break 
serialization for those geometries.
elasticsearchmachine pushed a commit that referenced this pull request Sep 22, 2025
… (#135190)

Small polygons with holes can compute negative weights due to rounding errors and break 
serialization for those geometries.
elasticsearchmachine pushed a commit that referenced this pull request Sep 22, 2025
… (#135189)

Small polygons with holes can compute negative weights due to rounding errors and break 
serialization for those geometries.
gmjehovich pushed a commit to gmjehovich/elasticsearch that referenced this pull request Sep 22, 2025
…c#135176)

Small polygons with holes can compute negative weights due to rounding errors and break 
serialization for those geometries.
DonalEvans pushed a commit to DonalEvans/elasticsearch that referenced this pull request Sep 22, 2025
…c#135176)

Small polygons with holes can compute negative weights due to rounding errors and break 
serialization for those geometries.
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 auto-backport Automatically create backport pull requests when merged >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.19.5 v9.0.8 v9.1.5 v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error 500 on a valid geometry due to a negative centroidCalculator.sumWeight computation
3 participants