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

Karl Wright commented on LUCENE-7357:
-------------------------------------

The point is definitely supposed to be within the path, so isWithin() is 
working properly. It is within the segment part of the path, so the bounds for 
the segment should yield a bounding solid that is outside of the point.

But this isn't what happens.  The segment bounds include the four corner points:

{code}
   [junit4]   2> ULHC=[X=0.4449938827091463, Y=-0.8967828076912789, 
Z=-9.724499511975725E-13]
   [junit4]   2> URHC=[X=0.4449938827091463, Y=-0.8967828076912789, Z=0.0]
   [junit4]   2> LLHC=[X=0.4449938827091461, Y=0.8967828076912789, 
Z=-9.724499511975723E-13]
   [junit4]   2> LRHC=[X=0.4449938827091461, Y=0.8967828076912789, Z=0.0]
{code}

... none of which have an X value that would include the point's X value of 
0.44586529864043345.  The planes also yield a maximum/minimum X consistent with 
the same X values above.

The interesting thing is that the segment is actually a slice all the way 
through the world.  This is because it effectively has Z bounds and Y bounds 
but no X bounds.  It's an extremely thin slice, and thus what is considered 
inside might well be extended quite a distance on the other side if a line 
through the origin.  We've seen cases like this before.

So when we compute the bounds for this path segment, we have to be careful to 
allow for the MINIMUM_DISTANCE offset from the shape edge.  Therefore, I tried 
introducing .addIntersection() calls for the bounds for all four intersections 
between PathSegment edges, but this did not fix the problem.  I therefore have 
to think about why it didn't work.

> TestGeo3DPoint.testGeo3DRelations() failure: invalid bounds for 
> shape=GeoStandardPath
> -------------------------------------------------------------------------------------
>
>                 Key: LUCENE-7357
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7357
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/spatial3d
>            Reporter: Steve Rowe
>            Assignee: Karl Wright
>
> From [https://builds.apache.org/job/Lucene-Solr-Tests-master/1228/]:
> {noformat}
> Checking out Revision 46c827e31a5534bb032d0803318d01309bf0195c 
> (refs/remotes/origin/master)
> [...]
>   [junit4] Suite: org.apache.lucene.spatial3d.TestGeo3DPoint
>   [junit4]   1>     doc=1544 is contained by shape but is outside the 
> returned XYZBounds
>   [junit4]   1>       unquantized=[lat=-2.848117399637174E-91, 
> lon=-1.1092122135274942([X=0.44586529864043345, Y=-0.8963498732568058, 
> Z=-2.851304027160807E-91])]
>   [junit4]   1>       quantized=[X=0.44586529870253566, 
> Y=-0.8963498734280969, Z=-2.3309121299774915E-10]
>   [junit4]   1>   shape=GeoStandardPath: {planetmodel=PlanetModel.WGS84, 
> width=1.117010721276371(64.0), points={[[lat=2.18531083006635E-12, 
> lon=-3.141592653589793([X=-1.0011188539924791, Y=-1.226017000107956E-16, 
> Z=2.187755873813378E-12])], [lat=0.0, 
> lon=-3.141592653589793([X=-1.0011188539924791, Y=-1.226017000107956E-16, 
> Z=0.0])]]}}
>   [junit4]   1>   bounds=XYZBounds: [xmin=-1.0011188549924792 
> xmax=0.4449938894797613 ymin=-1.0011188549924792 ymax=1.0011188549924792 
> zmin=-0.9977622930221051 zmax=0.9977622930221051]
>   [junit4]   2> NOTE: reproduce with: ant test  -Dtestcase=TestGeo3DPoint 
> -Dtests.method=testGeo3DRelations -Dtests.seed=1F71744AE2101863 
> -Dtests.multiplier=2 -Dtests.slow=true -Dtests.locale=pt-PT 
> -Dtests.timezone=Europe/Berlin -Dtests.asserts=true 
> -Dtests.file.encoding=ISO-8859-1
>   [junit4] FAILURE 1.46s J1 | TestGeo3DPoint.testGeo3DRelations <<<
>   [junit4]    > Throwable #1: java.lang.AssertionError: invalid bounds for 
> shape=GeoStandardPath: {planetmodel=PlanetModel.WGS84, 
> width=1.117010721276371(64.0), points={[[lat=2.18531083006635E-12, 
> lon=-3.141592653589793([X=-1.0011188539924791, Y=-1.226017000107956E-16, 
> Z=2.187755873813378E-12])], [lat=0.0, 
> lon=-3.141592653589793([X=-1.0011188539924791, Y=-1.226017000107956E-16, 
> Z=0.0])]]}}
>   [junit4]    >       at 
> __randomizedtesting.SeedInfo.seed([1F71744AE2101863:AF0E09DE6D5DB6FF]:0)
>   [junit4]    >       at 
> org.apache.lucene.spatial3d.TestGeo3DPoint.testGeo3DRelations(TestGeo3DPoint.java:259)
>   [junit4]    >       at java.lang.Thread.run(Thread.java:745)
>   [junit4] IGNOR/A 0.00s J1 | TestGeo3DPoint.testRandomBig
>   [junit4]    > Assumption #1: 'nightly' test group is disabled (@Nightly())
>   [junit4]   2> NOTE: test params are: codec=Asserting(Lucene62), 
> sim=RandomSimilarity(queryNorm=false,coord=yes): {}, locale=pt-PT, 
> timezone=Europe/Berlin
>   [junit4]   2> NOTE: Linux 3.13.0-85-generic amd64/Oracle Corporation 
> 1.8.0_74 (64-bit)/cpus=4,threads=1,free=256210224,total=354418688
>   [junit4]   2> NOTE: All tests run in this JVM: [TestGeo3DPoint]
>   [junit4] Completed [10/11 (1!)] on J1 in 37.22s, 14 tests, 1 failure, 1 
> skipped <<< FAILURES!
> {noformat}
> Reproduces for me.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to