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-7967: Within check for GeoDegeneratePoint did not allow precision allowance.
Date Tue, 12 Sep 2017 12:35:06 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/master 708ed8fb4 -> b125107b7


LUCENE-7967: Within check for GeoDegeneratePoint did not allow precision allowance.


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

Branch: refs/heads/master
Commit: b8d48fa7a623cc4edb11998d44760555055f65eb
Parents: fe34e14
Author: Karl Wright <DaddyWri@gmail.com>
Authored: Tue Sep 12 08:34:39 2017 -0400
Committer: Karl Wright <DaddyWri@gmail.com>
Committed: Tue Sep 12 08:34:39 2017 -0400

----------------------------------------------------------------------
 .../apache/lucene/spatial3d/geom/GeoDegeneratePoint.java    | 2 +-
 .../spatial3d/geom/SimpleGeoPolygonRelationshipsTest.java   | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b8d48fa7/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePoint.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePoint.java
b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePoint.java
index 572d00a..fe9ac79 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePoint.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePoint.java
@@ -125,7 +125,7 @@ class GeoDegeneratePoint extends GeoPoint implements GeoPointShape {
 
   @Override
   public boolean isWithin(final double x, final double y, final double z) {
-    return x == this.x && y == this.y && z == this.z;
+    return this.isIdentical(x, y, z);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b8d48fa7/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/SimpleGeoPolygonRelationshipsTest.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/SimpleGeoPolygonRelationshipsTest.java
b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/SimpleGeoPolygonRelationshipsTest.java
index 2589a19..cab8e06 100644
--- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/SimpleGeoPolygonRelationshipsTest.java
+++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/SimpleGeoPolygonRelationshipsTest.java
@@ -24,6 +24,7 @@ import java.util.List;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Check relationship between polygon and GeoShapes of basic polygons. Normally we construct
@@ -737,6 +738,14 @@ public class SimpleGeoPolygonRelationshipsTest {
   }
 
   @Test
+  public void testDegeneratedPointInPole(){
+    GeoBBox bBox1 = GeoBBoxFactory.makeGeoBBox(PlanetModel.SPHERE, Math.PI*0.5, Math.PI*0.5,
0, 0);
+    GeoPoint point = new GeoPoint(PlanetModel.SPHERE, Math.PI*0.5,  Math.PI);
+    System.out.println("bbox1 = "+bBox1+"; point = "+point);
+    assertTrue(bBox1.isWithin(point));
+  }
+
+  @Test
   public void testDegeneratePathShape(){
     GeoPoint point1 = new GeoPoint(PlanetModel.SPHERE, 0, 0);
     GeoPoint point2 = new GeoPoint(PlanetModel.SPHERE, 0, 1);


Mime
View raw message