Skip to content

Commit cb13913

Browse files
Fix elastic#123425 numerical floating point edge case (elastic#127982)
1 parent 351e3b8 commit cb13913

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

libs/geo/src/test/java/org/elasticsearch/geometry/utils/SpatialEnvelopeVisitorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public void testVisitGeoPointsWrapping() {
134134
} else {
135135
// Both positive and negative x values exist, we need to decide which way to wrap the bbox
136136
double unwrappedWidth = maxPosX - minNegX;
137-
double wrappedWidth = (180 - minPosX) - (-180 - maxNegX);
137+
double wrappedWidth = 360.0 + maxNegX - minPosX;
138138
if (unwrappedWidth <= wrappedWidth) {
139139
// The smaller bbox is around the front of the planet, no dateline wrapping required
140140
assertRectangleResult(i + ": " + point, result, minNegX, maxPosX, maxY, minY, false);

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,6 @@ tests:
396396
- class: org.elasticsearch.xpack.esql.plugin.DataNodeRequestSenderIT
397397
method: testSearchWhileRelocating
398398
issue: https://github.com/elastic/elasticsearch/issues/127188
399-
- class: org.elasticsearch.geometry.utils.SpatialEnvelopeVisitorTests
400-
method: testVisitGeoPointsWrapping
401-
issue: https://github.com/elastic/elasticsearch/issues/123425
402399
- class: org.elasticsearch.xpack.remotecluster.CrossClusterEsqlRCS2EnrichUnavailableRemotesIT
403400
method: testEsqlEnrichWithSkipUnavailable
404401
issue: https://github.com/elastic/elasticsearch/issues/127368

0 commit comments

Comments
 (0)