You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by kw...@apache.org on 2017/11/24 15:37:58 UTC

[1/2] lucene-solr:master: LUCENE-8065: Some exact circles near 90 degrees are still concave because of planet model, so throw an exception when we construct one of those.

Repository: lucene-solr
Updated Branches:
  refs/heads/master 4a12e066b -> a65301de7


LUCENE-8065: Some exact circles near 90 degrees are still concave because of planet model, so throw an exception when we construct one of those.


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

Branch: refs/heads/master
Commit: a514a12d0cb34d40dd3a1561a6b92c83907b9bec
Parents: cc8802e
Author: Karl Wright <Da...@gmail.com>
Authored: Fri Nov 24 10:37:21 2017 -0500
Committer: Karl Wright <Da...@gmail.com>
Committed: Fri Nov 24 10:37:21 2017 -0500

----------------------------------------------------------------------
 .../apache/lucene/spatial3d/geom/GeoExactCircle.java |  6 +++++-
 .../apache/lucene/spatial3d/geom/GeoCircleTest.java  | 15 +++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a514a12d/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java
index 8bba244..1c79474 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java
@@ -221,7 +221,11 @@ class GeoExactCircle extends GeoBaseCircle {
       this.backBounds = backPlanes;
     }
     
-    this.edgePoints = new GeoPoint[]{edgePoint};      
+    this.edgePoints = new GeoPoint[]{edgePoint};
+    
+    if (!isWithin(northPoint) || !isWithin(southPoint) || !isWithin(eastPoint) || !isWithin(westPoint)) {
+      throw new IllegalArgumentException("Exact circle cannot be constructed this large given the planet model provided");
+    }
     //System.out.println("Is edgepoint within? "+isWithin(edgePoint));
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a514a12d/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoCircleTest.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoCircleTest.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoCircleTest.java
index 3f35ef3..a272d3d 100755
--- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoCircleTest.java
+++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoCircleTest.java
@@ -551,4 +551,19 @@ public class GeoCircleTest extends LuceneTestCase {
     assertEquals(westPoint.getLongitude(), bounds.getLeftLongitude(), 1e-2);
     assertEquals(eastPoint.getLongitude(), bounds.getRightLongitude(), 1e-2);
   }
+
+  @Test
+  public void testLUCENE8065(){
+    boolean isIllegal = false;
+    try {
+      GeoCircle circle1 = GeoCircleFactory.makeExactGeoCircle(PlanetModel.WGS84, 0.03186456479560385, -2.2254294002683617, 1.5702573535090856, 8.184299676008562E-6);
+    } catch (IllegalArgumentException e) {
+      isIllegal = true;
+    }
+    assertTrue(isIllegal);
+    /*
+    GeoCircle circle2 = GeoCircleFactory.makeExactGeoCircle(PlanetModel.WGS84, 0.03186456479560385, -2.2254294002683617 , 1.5698163157923914, 1.0E-5);
+    assertTrue(circle1.getRelationship(circle2) != GeoArea.DISJOINT);
+    */
+  }
 }


[2/2] lucene-solr:master: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/lucene-solr

Posted by kw...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/lucene-solr


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

Branch: refs/heads/master
Commit: a65301de7c19132c6fc055a350a96a2bfb90c45d
Parents: a514a12 4a12e06
Author: Karl Wright <Da...@gmail.com>
Authored: Fri Nov 24 10:37:50 2017 -0500
Committer: Karl Wright <Da...@gmail.com>
Committed: Fri Nov 24 10:37:50 2017 -0500

----------------------------------------------------------------------
 .../codecs/compressing/CompressingStoredFieldsIndexWriter.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------