[ 
https://issues.apache.org/jira/browse/LUCENE-7941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16142737#comment-16142737
 ] 

Karl Wright commented on LUCENE-7941:
-------------------------------------

[~ivera], please see below:

{quote}
I think actually the implementation of geoDegeneratePoint complies with the 
contract as it return CONTAINS/OVERLAPS (instead of WITHIN according to 
contract) when the geoDegeneratePoint lies in the boundary of the other shape .
{quote}

It sounds like you believe that the currently committed code is correct, then?  
It's hard to tell for sure.

{quote}
On the other hand, the implementation of other shapes might be not fully 
complaint as any shape that has a point in an edge of another shape will always 
return OVERLAPS/OVERLAPS. Therefore a circle inscribed in a rectangle will 
return OVERLAPS/OVERLAPS.
If this is acceptable, then there is nothing to be done.
{quote}

Yes, that's been the case all along.

{quote}
What it might be missing is a method in the the Plane; crossPlane(Plane 
lane,...) very similar to intersects but only return trues if intersects and 
has points in both sides of the other plane. With that functionaly the method 
getRelationship() can be more accurate according to contract.
{quote}

There is a Plane method already that does this:

{code}
  /**
   * Find the points between two planes, where one plane crosses the other, 
given a set of bounds.
   * Crossing is not just intersection; the planes cannot touch at just one 
point on the ellipsoid,
   * but must cross at two.
   *
   * @param planetModel is the planet model.
   * @param q is the plane to intersect with.
   * @param bounds are the bounds to consider to determine legal intersection 
points.
   * @return the set of legal crossing points, or null if the planes are 
numerically identical.
   */
  public GeoPoint[] findCrossings(final PlanetModel planetModel, final Plane q, 
final Membership... bounds) {
    if (isNumericallyIdentical(q)) {
      return null;
    }
    return findCrossings(planetModel, q, bounds, NO_BOUNDS);
  }
{code}

This code eliminates intersections that don't involve the planes actually 
crossing.  It's only used at the moment by GeoComplexPolygon, and has not been 
tested elsewhere.


> GeoDegeneratePoints return intersects when located in edge shape 
> -----------------------------------------------------------------
>
>                 Key: LUCENE-7941
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7941
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Ignacio Vera
>            Assignee: Karl Wright
>            Priority: Minor
>             Fix For: 6.7, master (8.0), 7.1
>
>         Attachments: LUCENE-7941-test.patch
>
>
>  If the degenerate Geopoint lays on the boundary of a shape, the 
> relationships between the objects are not symetrical:
> The bounding box "thinks" it contains the degenerated point.
> The degenerated point "thinks" it intersects the shape.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to