lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karl Wright (JIRA)" <>
Subject [jira] [Commented] (LUCENE-7941) GeoDegeneratePoints return intersects when located in edge shape
Date Sat, 26 Aug 2017 10:14:00 GMT


Karl Wright commented on LUCENE-7941:

[~ivera], please see below:

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 .

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

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.

Yes, that's been the case all along.

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

There is a Plane method already that does this:

   * Find the points between two planes, where one plane crosses the other, given a set of
   * 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);

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:
>             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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message