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

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

[~ivera], line 2500 of Plane.java is the start of a comment.  But if I have the 
right place (line 2305) then this is my response:

(1) The difference between intersects() and crosses() is what the code does 
with the situation where there is only ONE solution to the 
line-intersecting-world computation it is performing.  The code in question 
does differ from intersects() to crosses().

(2) The code you point out is trying to determine whether any of the two 
intersection points found are within the bounds.  If neither is within the 
bounds then we must return false.  But at this point we already know there are 
two intersection points on the globe; it does not matter whether one point is 
in bounds and the other is outside.

The way crosses() should behave differently from intersects() is that it should 
exclude solutions where the line of intersection touches the world at exactly 
one point.  That is the only difference.  That is what the math can compute; no 
more, and no less.  If you can, in detail, supply an example of where this 
fails to detect an edge crossing, or detects a crossing where it should not, 
please do so, and we can analyze it further.

Note that the same logic exactly is used for GeoComplexPolygon, so we have some 
thoughts that it might be actually doing the right thing, provided you 
understand what it is actually doing.  GeoComplexPolygon also uses infitesimal 
planes (that is, planes that have been moved a small distance one way or 
another) to count crossings, so maybe you will need to do something more to 
come up with a fully viable approach here.

My suspicion, though, is that we really don't get to independently calculate 
edge crossings from intersections in the way you would like -- at least not in 
a computationally acceptable manner.


> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to