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/09/12 12:36:14 UTC
lucene-solr:branch_6x: LUCENE-7967: Within check for
GeoDegeneratePoint did not allow precision allowance.
Repository: lucene-solr
Updated Branches:
refs/heads/branch_6x 1a55be800 -> bdd291824
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/bdd29182
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/bdd29182
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/bdd29182
Branch: refs/heads/branch_6x
Commit: bdd2918245fbc3dd55ef693231cb11f7ac367ccb
Parents: 1a55be8
Author: Karl Wright <Da...@gmail.com>
Authored: Tue Sep 12 08:34:39 2017 -0400
Committer: Karl Wright <Da...@gmail.com>
Committed: Tue Sep 12 08:36:08 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/bdd29182/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/bdd29182/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);