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/21 09:59:37 UTC
lucene-solr:master: LUCENE-8054: Fix exact circle construction to
correct failing test.
Repository: lucene-solr
Updated Branches:
refs/heads/master 1794ff679 -> 0516a5882
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/0516a588
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/0516a588
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/0516a588
Branch: refs/heads/master
Commit: 0516a58827c913663c2085c49c2ef2bf7891087e
Parents: 1794ff6
Author: Karl Wright <Da...@gmail.com>
Authored: Tue Nov 21 04:59:11 2017 -0500
Committer: Karl Wright <Da...@gmail.com>
Committed: Tue Nov 21 04:59:11 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/0516a588/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/0516a588/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);
+ }
}