You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2017/09/18 16:25:14 UTC
[40/50] lucene-solr:feature/autoscaling_72: LUCENE-7967: Within check
for GeoDegeneratePoint did not allow precision allowance.
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/feature/autoscaling_72
Commit: b8d48fa7a623cc4edb11998d44760555055f65eb
Parents: fe34e14
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: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);