lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject [1/2] lucene-solr:master: LUCENE-7965: GeoBBoxFactory was constructing the wrong shape at the poles, if the longitude range provided was greater than 180 degrees.
Date Sat, 09 Sep 2017 05:03:11 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/master c229dc328 -> 8452edb13


LUCENE-7965: GeoBBoxFactory was constructing the wrong shape at the poles, if the longitude
range provided was greater than 180 degrees.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/fe7582e9
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/fe7582e9
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/fe7582e9

Branch: refs/heads/master
Commit: fe7582e9d725b0fbeeac03a901203dfd45813266
Parents: 2b6c82e
Author: Karl Wright <DaddyWri@gmail.com>
Authored: Sat Sep 9 01:01:33 2017 -0400
Committer: Karl Wright <DaddyWri@gmail.com>
Committed: Sat Sep 9 01:01:33 2017 -0400

----------------------------------------------------------------------
 .../org/apache/lucene/spatial3d/geom/GeoBBoxFactory.java    | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/fe7582e9/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBBoxFactory.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBBoxFactory.java
b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBBoxFactory.java
index d0427bc..12d479b 100755
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBBoxFactory.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBBoxFactory.java
@@ -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);


Mime
View raw message