Aggregations: Fixed failures when geo points are all either positive or negative

This commit is contained in:
Colin Goodheart-Smithe 2014-06-04 09:07:31 +01:00
parent 288eb3d803
commit f78480a0bc
1 changed files with 2 additions and 2 deletions

View File

@ -172,9 +172,9 @@ public class InternalGeoBounds extends InternalMetricsAggregation implements Geo
if (Double.isInfinite(top)) { if (Double.isInfinite(top)) {
return null; return null;
} else if (Double.isInfinite(posLeft)) { } else if (Double.isInfinite(posLeft)) {
return new BoundingBox(new GeoPoint(top, negLeft), new GeoPoint(bottom, posRight)); return new BoundingBox(new GeoPoint(top, negLeft), new GeoPoint(bottom, negRight));
} else if (Double.isInfinite(negLeft)) { } else if (Double.isInfinite(negLeft)) {
return new BoundingBox(new GeoPoint(top, posLeft), new GeoPoint(bottom, negRight)); return new BoundingBox(new GeoPoint(top, posLeft), new GeoPoint(bottom, posRight));
} else if (wrapLongitude) { } else if (wrapLongitude) {
double unwrappedWidth = posRight - negLeft; double unwrappedWidth = posRight - negLeft;
double wrappedWidth = (180 - posLeft) - (-180 - negRight); double wrappedWidth = (180 - posLeft) - (-180 - negRight);