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

Karl Wright commented on LUCENE-8281:
-------------------------------------

I'm actually more or less stumped by this.  Here's my debug output.  There are 
two operations here; first, figure out of the second test point is in-set or 
not:

{code}
   [junit4]   1> Determining in-set-ness of test point2 
([X=-0.9999999999993657, Y=-1.124732395751746E-6, Z=-5.8143386268861615E-8]):
   [junit4]   1> 
   [junit4]   1> IsInSet called for 
[-0.9999999999993657,-1.124732395751746E-6,-5.8143386268861615E-8], 
testPoint=[lat=5.8143386268861655E-8, 
lon=1.1247323957519851E-6([X=0.9999999999993657, Y=1.124732395751746E-6, 
Z=5.8143386268861615E-8])]; is in set? true
   [junit4]   1>  Using two planes
   [junit4]   1>  Picking XZ then XY
   [junit4]   1>  Finding whether [X=0.9999999999993657, 
Y=-1.124732395751746E-6, Z=5.8143386268861615E-8] is in-set, based on travel 
from [lat=5.8143386268861655E-8, 
lon=1.1247323957519851E-6([X=0.9999999999993657, Y=1.124732395751746E-6, 
Z=5.8143386268861615E-8])] along [A=0.0, B=0.0; C=1.0; 
D=-5.8143386268861615E-8] (value=5.8143386268861615E-8)
   [junit4]   1>  Constructing sector linear crossing edge iterator
   [junit4]   1>  Edge [[lat=-2.7797906712270083E-7, 
lon=1.8357011217773334E-6([X=0.9999999999982765, Y=1.8357011217762314E-6, 
Z=-2.7797906712269723E-7])] --> [lat=4.492749557241206E-7, 
lon=1.8019115568534971E-6([X=0.9999999999982758, Y=1.8019115568523405E-6, 
Z=4.492749557241056E-7])]] potentially crosses travel plane [A=0.0, B=0.0; 
C=1.0; D=-5.8143386268861615E-8]
   [junit4]   1>   There are no intersection points within bounds.
   [junit4]   1>    Endpoint(s) of edge are not on travel plane
   [junit4]   1>  Edge [[lat=1.255403467900245E-6, 
lon=1.3751481926504994E-6([X=0.9999999999982665, Y=1.3751481926489823E-6, 
Z=1.2554034678999154E-6])] --> [lat=1.640689686301266E-25, lon=0.0([X=1.0, 
Y=0.0, Z=1.640689686301266E-25])]] potentially crosses travel plane [A=0.0, 
B=0.0; C=1.0; D=-5.8143386268861615E-8]
   [junit4]   1>   There were intersection points!
   [junit4]   1>  Edge [[lat=1.255403467900245E-6, 
lon=1.3751481926504994E-6([X=0.9999999999982665, Y=1.3751481926489823E-6, 
Z=1.2554034678999154E-6])] --> [lat=1.640689686301266E-25, lon=0.0([X=1.0, 
Y=0.0, Z=1.640689686301266E-25])]] intersects travel plane [A=0.0, B=0.0; 
C=1.0; D=-5.8143386268861615E-8]
   [junit4]   1>   Intersection point in-set? false
   [junit4]   1>  Finding whether 
[-0.9999999999993657,-1.124732395751746E-6,-5.8143386268861615E-8] is in-set, 
based on travel from [X=0.9999999999993657, Y=-1.124732395751746E-6, 
Z=5.8143386268861615E-8] along [A=0.0, B=1.0; C=0.0; D=1.124732395751746E-6] 
(value=-1.124732395751746E-6)
   [junit4]   1>  Constructing full linear crossing edge iterator
   [junit4]   1>  Check point in set? false
   [junit4]   1> 
{code}

When that is done, the code fires off an assertion, that basically says if you 
go back to the first test point, you should get the same in-set-ness for it 
that you started with:

{code}
   [junit4]   1> ... done.  Checking against test point1 
([lat=5.8143386268861655E-8, lon=1.1247323957519851E-6([X=0.9999999999993657, 
Y=1.124732395751746E-6, Z=5.8143386268861615E-8])]):
   [junit4]   1> 
   [junit4]   1> IsInSet called for 
[0.9999999999993657,1.124732395751746E-6,5.8143386268861615E-8], 
testPoint=[X=-0.9999999999993657, Y=-1.124732395751746E-6, 
Z=-5.8143386268861615E-8]; is in set? false
   [junit4]   1>  Using two planes
   [junit4]   1>  Picking XZ then XY
   [junit4]   1>  Finding whether [X=0.9999999999993657, 
Y=1.124732395751746E-6, Z=-5.8143386268861615E-8] is in-set, based on travel 
from [X=-0.9999999999993657, Y=-1.124732395751746E-6, Z=-5.8143386268861615E-8] 
along [A=0.0, B=0.0; C=1.0; D=5.8143386268861615E-8] 
(value=-5.8143386268861615E-8)
   [junit4]   1>  Constructing sector linear crossing edge iterator
   [junit4]   1>  Edge [[lat=-2.7797906712270083E-7, 
lon=1.8357011217773334E-6([X=0.9999999999982765, Y=1.8357011217762314E-6, 
Z=-2.7797906712269723E-7])] --> [lat=4.492749557241206E-7, 
lon=1.8019115568534971E-6([X=0.9999999999982758, Y=1.8019115568523405E-6, 
Z=4.492749557241056E-7])]] potentially crosses travel plane [A=0.0, B=0.0; 
C=1.0; D=5.8143386268861615E-8]
   [junit4]   1>   There are no intersection points within bounds.
   [junit4]   1>    Endpoint(s) of edge are not on travel plane
   [junit4]   1>  Edge [[lat=1.640689686301266E-25, lon=0.0([X=1.0, Y=0.0, 
Z=1.640689686301266E-25])] --> [lat=-1.135982425157425E-6, 
lon=6.109011074784121E-7([X=0.9999999999991683, Y=6.1090110747798E-7, 
Z=-1.1359824251571808E-6])]] potentially crosses travel plane [A=0.0, B=0.0; 
C=1.0; D=5.8143386268861615E-8]
   [junit4]   1>   There are no intersection points within bounds.
   [junit4]   1>    Endpoint(s) of edge are not on travel plane
   [junit4]   1>   Intersection point in-set? false
   [junit4]   1>  Finding whether 
[0.9999999999993657,1.124732395751746E-6,5.8143386268861615E-8] is in-set, 
based on travel from [X=0.9999999999993657, Y=1.124732395751746E-6, 
Z=-5.8143386268861615E-8] along [A=0.0, B=1.0; C=0.0; D=-1.124732395751746E-6] 
(value=1.124732395751746E-6)
   [junit4]   1>  Constructing sector linear crossing edge iterator
   [junit4]   1>  Edge [[lat=-1.135982425157425E-6, 
lon=6.109011074784121E-7([X=0.9999999999991683, Y=6.1090110747798E-7, 
Z=-1.1359824251571808E-6])] --> [lat=-2.7797906712270083E-7, 
lon=1.8357011217773334E-6([X=0.9999999999982765, Y=1.8357011217762314E-6, 
Z=-2.7797906712269723E-7])]] potentially crosses travel plane [A=0.0, B=1.0; 
C=0.0; D=-1.124732395751746E-6]
   [junit4]   1>   There are no intersection points within bounds.
   [junit4]   1>    Endpoint(s) of edge are not on travel plane
   [junit4]   1>  Edge [[lat=1.255403467900245E-6, 
lon=1.3751481926504994E-6([X=0.9999999999982665, Y=1.3751481926489823E-6, 
Z=1.2554034678999154E-6])] --> [lat=1.640689686301266E-25, lon=0.0([X=1.0, 
Y=0.0, Z=1.640689686301266E-25])]] potentially crosses travel plane [A=0.0, 
B=1.0; C=0.0; D=-1.124732395751746E-6]
   [junit4]   1>   There are no intersection points within bounds.
   [junit4]   1>    Endpoint(s) of edge are not on travel plane
   [junit4]   1>  Check point in set? false
{code}

Note that there are two very different pairs of travel planes chosen for the 
first isInSet() check than for the second.  Both should be valid, and should 
yield the same number of crossings.  But they don't.  The first pair of planes 
has a crossing (a single one), culled from two possibilities.  The second has 
four possibilities, but zero intersections.  The first pair has one 
full-180-length span, while the second doesn't.

[~ivera], I need to find the error here.  (1) Are we missing any potential 
crossings that we should be picking up?  (2) Are we finding a potential 
crossing that is probably an intersection that isn't being detected as such?



> Random polygon test failures
> ----------------------------
>
>                 Key: LUCENE-8281
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8281
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/spatial3d
>            Reporter: Karl Wright
>            Assignee: Karl Wright
>            Priority: Major
>         Attachments: LUCENE-8281.jpg
>
>
> Reproduce here:
> {code}
> ant test  -Dtestcase=RandomGeoPolygonTest 
> -Dtests.method=testCompareSmallPolygons -Dtests.seed=42573983280EE568 
> -Dtests.multiplier=3 -Dtests.slow=true -Dtests.locale=jmc-TZ 
> -Dtests.timezone=US/Alaska -Dtests.asserts=true -Dtests.file.encoding=US-ASCII
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to