mirror of https://github.com/apache/lucene.git
LUCENE-7967: Within check for GeoDegeneratePoint did not allow precision allowance.
This commit is contained in:
parent
fe34e141ca
commit
b8d48fa7a6
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
@ -736,6 +737,14 @@ public class SimpleGeoPolygonRelationshipsTest {
|
|||
assertEquals(GeoArea.CONTAINS, rel);
|
||||
}
|
||||
|
||||
@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);
|
||||
|
|
Loading…
Reference in New Issue