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

Karl Wright edited comment on LUCENE-6699 at 8/19/15 6:44 PM:
--------------------------------------------------------------

Hmm, I couldn't reproduce this with a simple test.
Here's the failure detail:
{code}
   [junit4]   2> java.lang.AssertionError:
   Solid=XYZSolid: {planetmodel=PlanetModel.SPHERE, isWholeWorld=false, 
minXplane=[A=1.0, B=0.0, C=0.0, D=-0.9999778774751769, side=1.0], 
maxXplane=[A=1.0, B=0.0, C=0.0, D=-0.9999780900134368, side=-1.0], 
minYplane=[A=0.0, B=1.0, C=0.0, D=0.002943435994670142, side=1.0], 
maxYplane=[A=0.0, B=1.0, C=0.0, D=0.0029114063562165494, side=-1.0], 
minZplane=[A=0.0, B=0.0, C=1.0, D=0.005971010432932473, side=1.0], 
maxZplane=[A=0.0, B=0.0, C=1.0, D=0.005938981247250581, side=-1.0]};
   Shape=GeoCircle: {planetmodel=PlanetModel.SPHERE, 
center=[X=0.9999779838725235, Y=-0.0029274211758186968, 
Z=-0.0059549958440800015], radius=1.601488279374338E-5(9.175851934781766E-4)}
{code}

Here's the test code I created that passes:

{code}
    c = new GeoCircle(PlanetModel.SPHERE, -0.00595503104063, -0.00292747726474, 
1.601488279374338E-5);
    xyzb = new XYZBounds();
    c.getBounds(xyzb);
    GeoArea area = GeoAreaFactory.makeGeoArea(PlanetModel.SPHERE,
      xyzb.getMinimumX(), xyzb.getMaximumX(), xyzb.getMinimumY(), 
xyzb.getMaximumY(), xyzb.getMinimumZ(), xyzb.getMaximumZ());
    
    int relationship = area.getRelationship(c);
    assertTrue(relationship == GeoArea.WITHIN || relationship == 
GeoArea.OVERLAPS);
{code}

Here's the math I did to get there:

{code}
>>> Z=-0.0059549958440800015
>>> Y=-0.0029274211758186968
>>> X=0.9999779838725235
>>> print math.asin(Z)
-0.00595503104063
>>> print math.atan2(Y,X)
-0.00292747726474
>>>
{code}




was (Author: kwri...@metacarta.com):
Hmm, I couldn't reproduce this with a simple test.
Here's the failure detail:
{code}
   [junit4]   2> java.lang.AssertionError:
   Solid=XYZSolid: {planetmodel=PlanetModel.SPHERE, isWholeWorld=false, 
minXplane=[A=1.0, B=0.0, C=0.0, D=-0.9999778774751769, side=1.0], 
maxXplane=[A=1.0, B=0.0, C=0.0, D=-0.9999780900134368, side=-1.0], 
minYplane=[A=0.0, B=1.0, C=0.0, D=0.002943435994670142, side=1.0], 
maxYplane=[A=0.0, B=1.0, C=0.0, D=0.0029114063562165494, side=-1.0], 
minZplane=[A=0.0, B=0.0, C=1.0, D=0.005971010432932473, side=1.0], 
maxZplane=[A=0.0, B=0.0, C=1.0, D=0.005938981247250581, side=-1.0]};
   Shape=GeoCircle: {planetmodel=PlanetModel.SPHERE, 
center=[X=0.9999779838725235, Y=-0.0029274211758186968, 
Z=-0.0059549958440800015], radius=1.601488279374338E-5(9.175851934781766E-4)}
{code}

Here's the test code I created that passes:

{code}
    c = new GeoCircle(PlanetModel.SPHERE, -0.00595503104063, -0.00292747726474, 
1.601488279374338E-5);
    xyzb = new XYZBounds();
    c.getBounds(xyzb);
    GeoArea area = GeoAreaFactory.makeGeoArea(PlanetModel.SPHERE,
      xyzb.getMinimumX(), xyzb.getMaximumX(), xyzb.getMinimumY(), 
xyzb.getMaximumY(), xyzb.getMinimumZ(), xyzb.getMaximumZ());
    
    int relationship = area.getRelationship(c);
    assertTrue(relationship == GeoArea.WITHIN || relationship == 
GeoArea.OVERLAPS);
{code}


> Integrate lat/lon BKD and spatial3d
> -----------------------------------
>
>                 Key: LUCENE-6699
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6699
>             Project: Lucene - Core
>          Issue Type: New Feature
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>         Attachments: Geo3DPacking.java, LUCENE-6699.patch, LUCENE-6699.patch, 
> LUCENE-6699.patch, LUCENE-6699.patch, LUCENE-6699.patch, LUCENE-6699.patch, 
> LUCENE-6699.patch, LUCENE-6699.patch, LUCENE-6699.patch, LUCENE-6699.patch, 
> LUCENE-6699.patch, LUCENE-6699.patch, LUCENE-6699.patch, LUCENE-6699.patch, 
> LUCENE-6699.patch, LUCENE-6699.patch, LUCENE-6699.patch, LUCENE-6699.patch, 
> LUCENE-6699.patch, LUCENE-6699.patch
>
>
> I'm opening this for discussion, because I'm not yet sure how to do
> this integration, because of my ignorance about spatial in general and
> spatial3d in particular :)
> Our BKD tree impl is very fast at doing lat/lon shape intersection
> (bbox, polygon, soon distance: LUCENE-6698) against previously indexed
> points.
> I think to integrate with spatial3d, we would first need to record
> lat/lon/z into doc values.  Somewhere I saw discussion about how we
> could stuff all 3 into a single long value with acceptable precision
> loss?  Or, we could use BinaryDocValues?  We need all 3 dims available
> to do the fast per-hit query time filtering.
> But, second: what do we index into the BKD tree?  Can we "just" index
> earth surface lat/lon, and then at query time is spatial3d able to
> give me an enclosing "surface lat/lon" bbox for a 3d shape?  Or
> ... must we index all 3 dimensions into the BKD tree (seems like this
> could be somewhat wasteful)?



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