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

Karl Wright commented on LUCENE-8696:
-------------------------------------

More debugging shows that the second circle plane is wildly different in the 
two runs:

{code}
   [junit4]   1> Checking 'iswithin' for 0.020717830200521595 
0.9523290534985549 0.30699177254488114
   [junit4]   1>  pathPoint...
   [junit4]   1>   outside of circle [A=0.9998476951745469, 
B=0.01745240539714465, C=-0.0, D=-0.5409068252602056, side=1.0]
   [junit4]   1>  pathPoint...
   [junit4]   1>   passes circle plane [A=0.7071067811865476, 
B=-0.7071067811865476, C=0.0, D=0.05929892163149414, side=-1.0]
   [junit4]   1>   within!
   [junit4]   1> Checking 'iswithin' for 0.020717830200521595 
0.9523290534985549 0.30699177254488114
   [junit4]   1>  pathPoint...
   [junit4]   1>   outside of circle [A=0.9998476951745469, 
B=0.017452405397144648, C=-0.0, D=-0.22520274172912894, side=1.0]
   [junit4]   1>  pathPoint...
   [junit4]   1>   outside of circle [A=0.7863183388224225, 
B=-0.6178215519319035, C=0.0, D=-0.0021572780909792644, side=1.0]
   [junit4]   1>  pathPoint...
   [junit4]   1>   outside of cutoff plane [A=0.6045468388328157, 
B=-0.796569594986684, C=-3.0241383426688587E-48, D=0.0, side=1.0]
   [junit4]   1>  pathPoint...
   [junit4]   1>   outside of cutoff plane [A=-0.6885949363624547, 
B=-0.29030954074708304, C=-0.6644978436136604, D=0.0, side=1.0]
   [junit4]   1>  segment...
   [junit4]   1>  segment...
   [junit4]   1>  segment...
{code}

For the successful run it's: [A=0.7071067811865476, B=-0.7071067811865476, 
C=0.0, D=0.05929892163149414, side=-1.0]
For the failed run it's: [A=0.7863183388224225, B=-0.6178215519319035, C=0.0, 
D=-0.0021572780909792644, side=1.0]

The naive expectation would be that the vector is identical (A,B,C), but the 
displacement differs (D).  But because this is WGS84, that expectation is 
incorrect, because oblateness can affect the vector.  Because of oblateness, 
the circle is constructed from three of the four points where the segment edges 
intersect.  Which three it picks is random, but the hope is that the selection 
is not important.

What this shows is that very wide paths on oblate spheroids are mathematically 
unrelatable to each other.  This is not exactly surprising in retrospect; paths 
were originally designed for a SPHERE world and retrofitting them to WGS84 
involved compromises.

I therefore think the best approach might be to modify the test suite to limit 
the width of paths tested on WGS84.  [~ivera], what do you think?



> TestGeo3DPoint.testGeo3DRelations failure
> -----------------------------------------
>
>                 Key: LUCENE-8696
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8696
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/spatial3d
>            Reporter: Ignacio Vera
>            Assignee: Karl Wright
>            Priority: Major
>         Attachments: LUCENE-8696.patch
>
>
> Reproduce with:
> {code:java}
> ant test  -Dtestcase=TestGeo3DPoint -Dtests.method=testGeo3DRelations 
> -Dtests.seed=721195D0198A8470 -Dtests.slow=true -Dtests.badapples=true 
> -Dtests.locale=sr-RS -Dtests.timezone=Europe/Istanbul -Dtests.asserts=true 
> -Dtests.file.encoding=ISO-8859-1{code}
> Error:
> {code:java}
>    [junit4] FAILURE 1.16s | TestGeo3DPoint.testGeo3DRelations <<<
>    [junit4]    > Throwable #1: java.lang.AssertionError: invalid hits for 
> shape=GeoStandardPath: {planetmodel=PlanetModel.WGS84, 
> width=1.3439035240356338(77.00000000000001), 
> points={[[lat=2.4457272005608357E-47, 
> lon=0.017453291479645996([X=1.0009663787601641, Y=0.017471932090601616, 
> Z=2.448463612203698E-47])], [lat=2.4457272005608357E-47, 
> lon=0.8952476719156919([X=0.6260252093310985, Y=0.7812370940381473, 
> Z=2.448463612203698E-47])], [lat=2.4457272005608357E-47, 
> lon=0.6491968536639036([X=0.7974608400583222, Y=0.6052232384770843, 
> Z=2.448463612203698E-47])], [lat=-0.7718789008737459, 
> lon=0.9236607495528212([X=0.43181767034308555, Y=0.5714183775701452, 
> Z=-0.6971214014446648])]]}}{code}



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