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

Karl Wright commented on LUCENE-8512:
-------------------------------------

I started looking at this.
Basically, the problem is that during construction of the GeoComplexPolygon we 
come up with two points from which to compute crossings: the test point, and 
the antipodes of the test point.  We then compute whether the antipodes of the 
test point is in set, and as a confirmation, we compute whether the original 
point is in set if you start at the test point.  It's that check that fails.

In this case, logging additions show that the two traversals take different 
paths.  One path is apparently yielding the right answer, but the other is not:

{code}
   [junit4]   1> traveling from point1 to point2...
   [junit4]   1>
   [junit4]   1> IsInSet called for 
[0.30714981250962886,0.2184407265252787,-0.9262519320737786], 
testPoint=[X=-0.30714981250962886, Y=-0.2184407265252787, 
Z=0.9262519320737786]; is in set? true
   [junit4]   1>  Using two planes
   [junit4]   1> Trying traversal strategy {firstLegValue=-0.2184407265252787; 
secondLegValue=0.30714981250962886; firstLegPlane=[A=0.0, B=1.0; C=0.0; 
D=0.2184407265252787]; secondLegPlane=[A=1.0, B=0.0; C=0.0; 
D=-0.30714981250962886]; intersectionPoint=[X=0.30714981250962886, 
Y=-0.2184407265252787, Z=0.9262519320737789]}
   [junit4]   1> Applying traversal strategy...
   [junit4]   1> traveling from poin2 to point1...
   [junit4]   1>
   [junit4]   1> IsInSet called for 
[-0.30714981250962886,-0.2184407265252787,0.9262519320737786], 
testPoint=[X=0.30714981250962886, Y=0.2184407265252787, Z=-0.9262519320737786]; 
is in set? true
   [junit4]   1>  Using two planes
   [junit4]   1> Trying traversal strategy {firstLegValue=0.2184407265252787; 
secondLegValue=-0.30714981250962886; firstLegPlane=[A=0.0, B=1.0; C=0.0; 
D=-0.2184407265252787]; secondLegPlane=[A=1.0, B=0.0; C=0.0; 
D=0.30714981250962886]; intersectionPoint=[X=-0.30714981250962886, 
Y=0.2184407265252787, Z=0.9262519320737789]}
   [junit4]   1> Applying traversal strategy...
{code}

[~ivera], what I need to know is which traversal (p1->p2 or p2->p1) is yielding 
the incorrect result.  Some visualization would help a lot I think.


> GeoPolygon test failure
> -----------------------
>
>                 Key: LUCENE-8512
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8512
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/spatial3d
>            Reporter: Ignacio Vera
>            Assignee: Karl Wright
>            Priority: Major
>         Attachments: LUCENE-8512.patch
>
>
>  
> {code:java}
>   [junit4]   2> NOTE: reproduce with: ant test  
> -Dtestcase=RandomGeoPolygonTest -Dtests.method=testCompareSmallPolygons 
> -Dtests.seed=7BA5F34669E15F97 -Dtests.slow=true -Dtests.badapples=true 
> -Dtests.locale=es-CU -Dtests.timezone=America/La_Paz -Dtests.asserts=true 
> -Dtests.file.encoding=UTF8
>    [junit4] FAILURE 0.01s | RandomGeoPolygonTest.testCompareSmallPolygons 
> {seed=[7BA5F34669E15F97:F73170EC892310D]} <<<
>    [junit4]    > Throwable #1: java.lang.AssertionError: Test point1 not 
> correctly in/out of set according to test point2
>    [junit4]    > at 
> __randomizedtesting.SeedInfo.seed([7BA5F34669E15F97:F73170EC892310D]:0)
>    [junit4]    > at 
> org.apache.lucene.spatial3d.geom.GeoComplexPolygon.<init>(GeoComplexPolygon.java:239)
>    [junit4]    > at 
> org.apache.lucene.spatial3d.geom.GeoPolygonFactory$BestShape.createGeoComplexPolygon(GeoPolygonFactory.java:465)
>    [junit4]    > at 
> org.apache.lucene.spatial3d.geom.GeoPolygonFactory.makeLargeGeoPolygon(GeoPolygonFactory.java:389)
>    [junit4]    > at 
> org.apache.lucene.spatial3d.geom.GeoPolygonFactory.makeGeoPolygon(GeoPolygonFactory.java:226)
>    [junit4]    > at 
> org.apache.lucene.spatial3d.geom.GeoPolygonFactory.makeGeoPolygon(GeoPolygonFactory.java:142)
>    [junit4]    > at 
> org.apache.lucene.spatial3d.geom.RandomGeoPolygonTest.testComparePolygons(RandomGeoPolygonTest.java:157)
>    [junit4]    > at 
> org.apache.lucene.spatial3d.geom.RandomGeoPolygonTest.testCompareSmallPolygons(RandomGeoPolygonTest.java:109)
>    [junit4]    > at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>    [junit4]    > at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>    [junit4]    > at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>    [junit4]    > at java.base/java.lang.reflect.Method.invoke(Method.java:564)
>    [junit4]    > at java.base/java.lang.Thread.run(Thread.java:844)
>    [junit4] OK      0.34s | RandomGeoPolygonTest.testCompareSmallPolygons 
> {seed=[7BA5F34669E15F97:3DDFF260BF592657]}
>    [junit4] OK      0.35s | RandomGeoPolygonTest.testCompareSmallPolygons 
> {seed=[7BA5F34669E15F97:EA54A4DADB0E1105]}
>    [junit4]   2> NOTE: test params are: 
> codec=HighCompressionCompressingStoredFields(storedFieldsFormat=CompressingStoredFieldsFormat(compressionMode=HIGH_COMPRESSION,
>  chunkSize=1818, maxDocsPerChunk=791, blockSize=936), 
> termVectorsFormat=CompressingTermVectorsFormat(compressionMode=HIGH_COMPRESSION,
>  chunkSize=1818, blockSize=936)), sim=RandomSimilarity(queryNorm=false): {}, 
> locale=es-CU, timezone=America/La_Paz{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