# [jira] [Commented] (LUCENE-8251) Test failure, geo3d complex polygons

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

Karl Wright commented on LUCENE-8251:
-------------------------------------

Confirmed that the envelope plane and the edge plane are nearly parallel.
Adjoining points on the edge plane that are ~1e-12 away from the intersection
point are still just about the same distance from the travel plane as before:

{code}
[junit4]   1> TestPoint plane: [lat=-1.1675693914784415,
lon=-1.8506150182993802E-4([X=0.39171238223740795, Y=-7.249088256978756E-5,
Z=-0.9182146655290553])] -> [X=1.0011188498955597, Y=-7.249088256978756E-5,
Z=-5.4114167758588356E-5]
[junit4]   1> Travel plane:
[1.0011188498955597,9.057045181228716E-5,3.5E-323] -> [X=1.0011188498955597,
Y=-7.249088256978756E-5, Z=-5.4114167758588356E-5]
[junit4]   1>
[junit4]   1> Considering edge [lat=-0.12884119701201008,
lon=-1.1577813992513593([X=0.39846895697760487, Y=-0.9092889699600809,
Z=-0.1286216320286114])] -> [lat=-0.8977173781916888,
lon=2.3672262552845993([X=-0.44522608342175374, Y=0.435509619
867484, Z=-0.7811731004355484])]
[junit4]   1>
[junit4]   1> Considering edge [lat=-6.4E-323,
lon=0.0([X=1.0011188539924791, Y=0.0, Z=-6.4E-323])] ->
[lat=-0.12884119701201008, lon=-1.1577813992513593([X=0.39846895697760487,
Y=-0.9092889699600809, Z=-0.1286216320286114])]
[junit4]   1>
[junit4]   1> Considering edge [lat=-1.0294747773716673,
lon=1.97235866074843([X=-0.20112459723348416, Y=0.47363995489643546,
Z=-0.8558716366345036])] -> [lat=-6.4E-323, lon=0.0([X=1.0011188539924791,
Y=0.0, Z=-6.4E-323])]
[junit4]   1>  Edge intersects travel or testPoint plane
[junit4]   1>  Assessing inner crossings...
[junit4]   1>   Assessing travel envelope intersection point
[X=1.0011188498945593, Y=4.374699550797305E-5, Z=-7.90512123316076E-5],
travelPlane distance=-1.000310945187266E-12...
Y=4.374699502377152E-5, Z=-7.905121145665111E-5] (intersection dist =
9.999999942608793E-13; travelPlane dist=-1.000310945187266E-12; testPointPlane
dist=1.1623787759355908E-4) is not within
Y=4.3746995992174576E-5, Z=-7.905121320656408E-5] (intersection dist =
1.0000000037738338E-12; travelPlane dist=-1.000532989792191E-12; testPointPlane
dist=1.1623787856196213E-4) is not within
[junit4]   1>  Assessing outer crossings...
[junit4]   1>   Assessing travel envelope intersection point
[X=1.00111884989656, Y=4.3736315090256196E-5, Z=-7.903191272122474E-5],
travelPlane distance=1.000310945187266E-12...
Y=4.3736314606054664E-5, Z=-7.903191184626825E-5] (intersection dist =
9.999999942608793E-13; travelPlane dist=1.000310945187266E-12; testPointPlane
dist=1.1622719717584222E-4) is not within

Y=4.373631557445772E-5, Z=-7.903191359618122E-5] (intersection dist =
1.0000000037738338E-12; travelPlane dist=1.000088900582341E-12; testPointPlane
dist=1.1622719814424528E-4) is not within
{code}

> Test failure, geo3d complex polygons
> ------------------------------------
>
>                 Key: LUCENE-8251
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8251
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/spatial3d
>    Affects Versions: master (8.0)
>            Reporter: Karl Wright
>            Assignee: Karl Wright
>            Priority: Major
>             Fix For: 6.7, 7.4, master (8.0)
>
>         Attachments: LUCENE-8251.jpg
>
>
> {code}
> Error Message:
>  Standard polygon: GeoCompositePolygon: {[GeoConvexPolygon:
> {planetmodel=PlanetModel.WGS84, points=[[lat=-0.12884119701201008,
> lon=-1.157781399251359([X=0.3984689569776051, Y=-0.9092889699600808,
> Z=-0.1286216320286114])], [lat=-0.8977173781916888,
> lon=2.3672262552845993([X=-0.44522608342175374, Y=0.435509619867484,
> Z=-0.7811731004355484])], [lat=-1.0294747773716673,
> lon=1.97235866074843([X=-0.20112459723348416, Y=0.47363995489643546,
> Z=-0.8558716366345036])]], internalEdges={2}}, GeoConvexPolygon:
> {planetmodel=PlanetModel.WGS84, points=[[lat=-0.12884119701201008,
> lon=-1.157781399251359([X=0.3984689569776051, Y=-0.9092889699600808,
> Z=-0.1286216320286114])], [lat=-1.0294747773716673,
> lon=1.97235866074843([X=-0.20112459723348416, Y=0.47363995489643546,
> Z=-0.8558716366345036])], [lat=-6.4E-323, lon=0.0([X=1.0011188539924791,
> Y=0.0, Z=-6.4E-323])]], internalEdges={0}}]}  Large polygon:
> GeoComplexPolygon: {planetmodel=PlanetModel.WGS84, number of shapes=1,
> lon=-1.850615018297906E-4([X=0.39171238223740806, Y=-7.249088256972983E-5,
> Z=-0.9182146655290553])], testPointInSet=true, shapes={
> {[lat=-0.12884119701201008, lon=-1.157781399251359([X=0.3984689569776051,
> Y=-0.9092889699600808, Z=-0.1286216320286114])], [lat=-0.8977173781916888,
> lon=2.3672262552845993([X=-0.44522608342175374, Y=0.435509619867484,
> Z=-0.7811731004355484])], [lat=-1.0294747773716673,
> lon=1.97235866074843([X=-0.20112459723348416, Y=0.47363995489643546,
> Z=-0.8558716366345036])], [lat=-6.4E-323, lon=0.0([X=1.0011188539924791,
> Y=0.0, Z=-6.4E-323])]}}  Point: [lat=3.5E-323,
> lon=9.046923007656787E-5([X=1.0011188498955597, Y=9.057045181228716E-5,
> Z=3.5E-323])]  WKT: POLYGON((135.63207358036593
> -51.43541696593334,113.00782694696038 -58.984559858566556,0.0
> -3.68E-321,-66.33598777585381 -7.382056816201731,135.63207358036593
> -51.43541696593334))  WKT: POINT(0.005183505059185348 1.98E-321) normal
> polygon: false large polygon: true
> Stack Trace:
> java.lang.AssertionError:
> Standard polygon: GeoCompositePolygon: {[GeoConvexPolygon:
> {planetmodel=PlanetModel.WGS84, points=[[lat=-0.12884119701201008,
> lon=-1.157781399251359([X=0.3984689569776051, Y=-0.9092889699600808,
> Z=-0.1286216320286114])], [lat=-0.8977173781916888,
> lon=2.3672262552845993([X=-0.44522608342175374, Y=0.435509619867484,
> Z=-0.7811731004355484])], [lat=-1.0294747773716673,
> lon=1.97235866074843([X=-0.20112459723348416, Y=0.47363995489643546,
> Z=-0.8558716366345036])]], internalEdges={2}}, GeoConvexPolygon:
> {planetmodel=PlanetModel.WGS84, points=[[lat=-0.12884119701201008,
> lon=-1.157781399251359([X=0.3984689569776051, Y=-0.9092889699600808,
> Z=-0.1286216320286114])], [lat=-1.0294747773716673,
> lon=1.97235866074843([X=-0.20112459723348416, Y=0.47363995489643546,
> Z=-0.8558716366345036])], [lat=-6.4E-323, lon=0.0([X=1.0011188539924791,
> Y=0.0, Z=-6.4E-323])]], internalEdges={0}}]}
> Large polygon: GeoComplexPolygon: {planetmodel=PlanetModel.WGS84, number of
> lon=-1.850615018297906E-4([X=0.39171238223740806, Y=-7.249088256972983E-5,
> Z=-0.9182146655290553])], testPointInSet=true, shapes={
> {[lat=-0.12884119701201008, lon=-1.157781399251359([X=0.3984689569776051,
> Y=-0.9092889699600808, Z=-0.1286216320286114])], [lat=-0.8977173781916888,
> lon=2.3672262552845993([X=-0.44522608342175374, Y=0.435509619867484,
> Z=-0.7811731004355484])], [lat=-1.0294747773716673,
> lon=1.97235866074843([X=-0.20112459723348416, Y=0.47363995489643546,
> Z=-0.8558716366345036])], [lat=-6.4E-323, lon=0.0([X=1.0011188539924791,
> Y=0.0, Z=-6.4E-323])]}}
> Point: [lat=3.5E-323, lon=9.046923007656787E-5([X=1.0011188498955597,
> Y=9.057045181228716E-5, Z=3.5E-323])]
> WKT: POLYGON((135.63207358036593 -51.43541696593334,113.00782694696038
> -58.984559858566556,0.0 -3.68E-321,-66.33598777585381
> -7.382056816201731,135.63207358036593 -51.43541696593334))
> WKT: POINT(0.005183505059185348 1.98E-321)
> normal polygon: false
> large polygon: true
>         at
> __randomizedtesting.SeedInfo.seed([C1E5FF7FBC7AC980:47CE8D3C5A69DD5B]:0)
>         at org.junit.Assert.fail(Assert.java:93)
>         at org.junit.Assert.assertTrue(Assert.java:43)
>         at
> org.apache.lucene.spatial3d.geom.RandomGeoPolygonTest.testComparePolygons(RandomGeoPolygonTest.java:179)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:498)
>         at
> com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1737)
>         at
> com.carrotsearch.randomizedtesting.RandomizedRunner\$8.evaluate(RandomizedRunner.java:934)
>         at
> com.carrotsearch.randomizedtesting.RandomizedRunner\$9.evaluate(RandomizedRunner.java:970)
>         at
> com.carrotsearch.randomizedtesting.RandomizedRunner\$10.evaluate(RandomizedRunner.java:984)
>         at
> org.apache.lucene.util.TestRuleSetupTeardownChained\$1.evaluate(TestRuleSetupTeardownChained.java:49)
>         at
> org.apache.lucene.util.AbstractBeforeAfterRule\$1.evaluate(AbstractBeforeAfterRule.java:45)
>         at
>         at
> org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures\$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
>         at
> org.apache.lucene.util.TestRuleMarkFailure\$1.evaluate(TestRuleMarkFailure.java:47)
>         at
>         at
>         at
>         at
>         at
> com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:943)
>         at
> com.carrotsearch.randomizedtesting.RandomizedRunner\$5.evaluate(RandomizedRunner.java:829)
>         at
> com.carrotsearch.randomizedtesting.RandomizedRunner\$6.evaluate(RandomizedRunner.java:879)
>         at
> com.carrotsearch.randomizedtesting.RandomizedRunner\$7.evaluate(RandomizedRunner.java:890)
>         at
> org.apache.lucene.util.AbstractBeforeAfterRule\$1.evaluate(AbstractBeforeAfterRule.java:45)
>         at
>         at
> org.apache.lucene.util.TestRuleStoreClassName\$1.evaluate(TestRuleStoreClassName.java:41)
>         at
>         at
>         at
>         at
>         at
>         at
> org.apache.lucene.util.TestRuleAssertionsRequired\$1.evaluate(TestRuleAssertionsRequired.java:53)
>         at
> org.apache.lucene.util.TestRuleMarkFailure\$1.evaluate(TestRuleMarkFailure.java:47)
>         at
> org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures\$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
>         at
> org.apache.lucene.util.TestRuleIgnoreTestSuites\$1.evaluate(TestRuleIgnoreTestSuites.java:54)
>         at
>         at