mirror of https://github.com/apache/lucene.git
LUCENE-7941: Broaden the contract for intersects() method, and implement the broadened contract in GeoDegeneratePoint.
This commit is contained in:
parent
287ab9dc40
commit
2b8cea09bb
|
@ -27,9 +27,10 @@ package org.apache.lucene.spatial3d.geom;
|
||||||
public interface GeoAreaShape extends GeoMembershipShape, GeoArea{
|
public interface GeoAreaShape extends GeoMembershipShape, GeoArea{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assess whether a shape intersects with any of the edges this shape.
|
* Assess whether a shape intersects with any of the edges of this shape.
|
||||||
* Note well that this method return false if the shape contains, is within
|
* Note well that this method must return false if the shape contains or is disjoint
|
||||||
* or is disjoint with the given shape.
|
* with the given shape. It is permissible to return true if the shape is within the
|
||||||
|
* specified shape, if it is difficult to compute intersection with edges.
|
||||||
*
|
*
|
||||||
* @param geoShape is the shape to assess for intersection with this shape's edges.
|
* @param geoShape is the shape to assess for intersection with this shape's edges.
|
||||||
*
|
*
|
||||||
|
|
|
@ -86,9 +86,10 @@ class GeoDegeneratePoint extends GeoPoint implements GeoBBox, GeoCircle {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean intersects(GeoShape geoShape) {
|
public boolean intersects(GeoShape geoShape) {
|
||||||
return false;
|
// We have no way of computing this properly, so return isWithin(), as we are allowed by contract.
|
||||||
|
return geoShape.isWithin(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getBounds(Bounds bounds) {
|
public void getBounds(Bounds bounds) {
|
||||||
bounds.addPoint(this);
|
bounds.addPoint(this);
|
||||||
|
|
Loading…
Reference in New Issue