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

Karl Wright commented on LUCENE-8245:
-------------------------------------

Ok, looking at the crossings we get, here's the complete output:

{code}
   [junit4]   1>
   [junit4]   1> Considering edge [lat=-1.4506713533447755, 
lon=-1.2251247551355924([X=0.04060395941016342, Y=-0.11274773940940182, 
Z=-0.9927936672533157])] -> [lat=4.9E-324, lon=0.0([X=1.0, Y=0.0, Z=4.9E-324])]
   [junit4]   1>  start point travel dist=-0.11274773940907501; end point 
travel dist=3.268072236836579E-13
   [junit4]   1>  start point travel above dist=-0.11274773940806501; end point 
travel above dist=1.336807223683658E-12
   [junit4]   1>  start point travel below dist=-0.11274773941008501; end point 
travel below dist=-6.831927763163422E-13
   [junit4]   1>  start point testpoint dist=-0.34019438500826027; end point 
testpoint dist=0.6525992822450555
   [junit4]   1>  start point testpoint above dist=-0.3401943850072502; end 
point testpoint above dist=0.6525992822460656
   [junit4]   1>  start point testpoint below dist=-0.34019438500927035; end 
point testpoint below dist=0.6525992822440454
   [junit4]   1>   Travel inner point [X=1.0, Y=-1.336807223683658E-12, 
Z=-1.1771178322187736E-11]; edgeplane=0.0; travelInsidePlane=0.0
   [junit4]   1>   Test point inner point [X=0.7540698997149413, 
Y=-0.07411317803504912, Z=-0.6525992822440454]; edgeplane=0.0; 
testPointInsidePlane=0.0
   [junit4]   1>  Edge added 2 to innerCrossingCount
   [junit4]   1>   Test point outer point [X=0.7540698997131706, 
Y=-0.07411317803527853, Z=-0.6525992822460656]; edgeplane=0.0; 
testPointOutsidePlane=0.0
   [junit4]   1>  Edge added 1 to outerCrossingCount
   [junit4]   1>
   [junit4]   1> Considering edge [lat=4.9E-324, lon=0.0([X=1.0, Y=0.0, 
Z=4.9E-324])] -> [lat=0.13953211802880663, 
lon=-2.443438340098597([X=-0.7585849990851791, Y=-0.6365576248361361, 
Z=0.139079795174987])]
   [junit4]   1>  start point travel dist=3.268072236836579E-13; end point 
travel dist=-0.6365576248358092
   [junit4]   1>  start point travel above dist=1.336807223683658E-12; end 
point travel above dist=-0.6365576248347993
   [junit4]   1>  start point travel below dist=-6.831927763163422E-13; end 
point travel below dist=-0.6365576248368193
   [junit4]   1>  start point testpoint dist=0.6525992822450555; end point 
testpoint dist=0.7916790774200425
   [junit4]   1>  start point testpoint above dist=0.6525992822460656; end 
point testpoint above dist=0.7916790774210526
   [junit4]   1>  start point testpoint below dist=0.6525992822440454; end 
point testpoint below dist=0.7916790774190324
   [junit4]   1>   Travel inner point [X=1.0, Y=-1.3368072236836578E-12, 
Z=2.920754816285907E-13]; edgeplane=-5.0487097934144756E-29; 
travelInsidePlane=2.0194839173657902E-28
   [junit4]   1>  Edge added 1 to innerCrossingCount
   [junit4]   1>   Travel outer point [X=1.0, Y=6.831927763163421E-13, 
Z=-1.4926898632243605E-13]; edgeplane=2.5243548967072378E-29; 
travelOutsidePlane=-1.0097419586828951E-28
   [junit4]   1>  Edge added 1 to outerCrossingCount   
{code}

The travel outer point it incorrectly finds has a distance to each intersecting 
plane that's on the order of 1e-28.  That basically says it's a real 
intersection given the inputs.  So that second edge does intersect the outer 
envelope EVEN THOUGH it doesn't look like it should, based on the endpoint.

The only other thing that can be going wrong is that the edge endpoint's bounds 
are just sloppy enough to permit this intersection to be included in the 
crossings list, while it really should be rejected.  I'll need more diagnostics 
to rule that in or out as the underlying cause, but I'm getting busy at work 
now so that's not going to happen for a while.


> GeoComplexPolygon fails when intersection of travel plane with edge is near 
> polygon point
> -----------------------------------------------------------------------------------------
>
>                 Key: LUCENE-8245
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8245
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/spatial3d
>            Reporter: Ignacio Vera
>            Assignee: Karl Wright
>            Priority: Major
>             Fix For: 6.7, 7.4, master (8.0)
>
>         Attachments: LUCENE-8245-case2.patch, LUCENE-8245.jpg, 
> LUCENE-8245.patch
>
>
> When a travel plane crosses an edge close to an edge point , it is possible 
> that the above and below planes crosses different edges. In the current 
> implementation one of the crosses is missed because we only check edges that 
> are crossed by the main plain and the {{within}} result is wrong.
> One possible fix is to check always the intersection of planes and edges 
> regardless if they are crossed by main plane. That fixed the above issue but 
> shows other issues like travel planes crossing two edges when it should be 
> only one due to the fuzziness at edge intersections.
> Not sure of a fix so I add the test showing the issue.
>  
>  



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

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

Reply via email to