mirror of https://github.com/apache/lucene.git
LUCENE-7965: GeoBBoxFactory was constructing the wrong shape at the poles, if the longitude range provided was greater than 180 degrees.
This commit is contained in:
parent
2b6c82ed32
commit
fe7582e9d7
|
@ -82,6 +82,11 @@ public class GeoBBoxFactory {
|
|||
//System.err.println(" not vertical line");
|
||||
if (extent >= Math.PI) {
|
||||
if (Math.abs(topLat - bottomLat) < Vector.MINIMUM_ANGULAR_RESOLUTION) {
|
||||
if (Math.abs(topLat - Math.PI * 0.5) < Vector.MINIMUM_ANGULAR_RESOLUTION) {
|
||||
return new GeoDegeneratePoint(planetModel, topLat, 0.0);
|
||||
} else if (Math.abs(bottomLat + Math.PI * 0.5) < Vector.MINIMUM_ANGULAR_RESOLUTION) {
|
||||
return new GeoDegeneratePoint(planetModel, bottomLat, 0.0);
|
||||
}
|
||||
//System.err.println(" wide degenerate line");
|
||||
return new GeoWideDegenerateHorizontalLine(planetModel, topLat, leftLon, rightLon);
|
||||
}
|
||||
|
@ -94,8 +99,10 @@ public class GeoBBoxFactory {
|
|||
return new GeoWideRectangle(planetModel, topLat, bottomLat, leftLon, rightLon);
|
||||
}
|
||||
if (Math.abs(topLat - bottomLat) < Vector.MINIMUM_ANGULAR_RESOLUTION) {
|
||||
if (Math.abs(topLat - Math.PI * 0.5) < Vector.MINIMUM_ANGULAR_RESOLUTION || Math.abs(topLat + Math.PI * 0.5) < Vector.MINIMUM_ANGULAR_RESOLUTION) {
|
||||
if (Math.abs(topLat - Math.PI * 0.5) < Vector.MINIMUM_ANGULAR_RESOLUTION) {
|
||||
return new GeoDegeneratePoint(planetModel, topLat, 0.0);
|
||||
} else if (Math.abs(bottomLat + Math.PI * 0.5) < Vector.MINIMUM_ANGULAR_RESOLUTION) {
|
||||
return new GeoDegeneratePoint(planetModel, bottomLat, 0.0);
|
||||
}
|
||||
//System.err.println(" horizontal line");
|
||||
return new GeoDegenerateHorizontalLine(planetModel, topLat, leftLon, rightLon);
|
||||
|
|
Loading…
Reference in New Issue