lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject lucene-solr:branch_6x: LUCENE-8054: Fix exact circle construction to correct failing test.
Date Tue, 21 Nov 2017 10:00:58 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x f452fb52b -> 01b02e1b5


LUCENE-8054: Fix exact circle construction to correct failing test.


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

Branch: refs/heads/branch_6x
Commit: 01b02e1b58c8489eff907a6f4effdea4c93c6fd0
Parents: f452fb5
Author: Karl Wright <DaddyWri@gmail.com>
Authored: Tue Nov 21 04:59:11 2017 -0500
Committer: Karl Wright <DaddyWri@gmail.com>
Committed: Tue Nov 21 05:00:50 2017 -0500

----------------------------------------------------------------------
 .../org/apache/lucene/spatial3d/geom/GeoExactCircle.java    | 4 ++--
 .../org/apache/lucene/spatial3d/geom/GeoCircleTest.java     | 9 ++++++++-
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/01b02e1b/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 3d278ea..a7b1b60 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
@@ -99,8 +99,8 @@ class GeoExactCircle extends GeoBaseCircle {
       edgePoint = eastPoint;
     } else {
       // z will be less than x or y, so ellipse is shorter than it is tall
-      slices.add(new ApproximationSlice(center, northPoint, Math.PI * 2.0, southPoint, Math.PI,
eastPoint, Math.PI * 0.5));
-      slices.add(new ApproximationSlice(center, southPoint, Math.PI, northPoint, 0.0, westPoint,
Math.PI * 1.5));
+      slices.add(new ApproximationSlice(center, northPoint, 0.0, southPoint, Math.PI, eastPoint,
Math.PI * 0.5));
+      slices.add(new ApproximationSlice(center, southPoint, Math.PI, northPoint, Math.PI
* 2.0, westPoint, Math.PI * 1.5));
       edgePoint = northPoint;
     }
       

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/01b02e1b/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 ad21eda..a486038 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
@@ -500,6 +500,13 @@ public class GeoCircleTest extends LuceneTestCase {
     assertTrue(success);
   }
 
-
+  @Test
+  public void testLUCENE8054(){
+    GeoCircle circle1 = GeoCircleFactory.makeExactGeoCircle(PlanetModel.WGS84, -1.0394053553992673,
-1.9037325881389144, 1.1546166170607672, 4.231100485201301E-4);
+    GeoCircle circle2 = GeoCircleFactory.makeExactGeoCircle(PlanetModel.WGS84, -1.3165961602008989,
-1.887137823746273, 1.432516663588956, 3.172052880854355E-4);
+    // Relationship between circles must be different than DISJOINT as centers are closer
than the radius.
+    int rel = circle1.getRelationship(circle2);
+    assertTrue(rel != GeoArea.DISJOINT);
+  }
   
 }


Mime
View raw message