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

Karl Wright commented on LUCENE-7212:
-------------------------------------

As for encoding, we basically get 20 bits per x, y, or z value.  If proximity 
is a requirement, then 3D morton encoding can be used:

http://stackoverflow.com/questions/1024754/how-to-compute-a-3d-morton-number-interleave-the-bits-of-3-ints

... but maybe that's not needed.
The twenty bits I would extract from the IEEE double, after scaling by the 
planetmodel max distance in the corresponding dimension.  So we'd know that the 
max value would be 1.0, and the min value would be -1.0, and thus we can select 
the most significant mantissa bits.  Or maybe it's easier to just multiply and 
Math.floor.  We'll see.  But 2^20 ~= 10^6, so precision is not great, but 
probably enough.

> Add Geo3DPoint equivalents of LatLonPointDistanceComparator and 
> LatLonPointSortField
> ------------------------------------------------------------------------------------
>
>                 Key: LUCENE-7212
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7212
>             Project: Lucene - Core
>          Issue Type: Improvement
>    Affects Versions: master
>            Reporter: Karl Wright
>            Assignee: Karl Wright
>
> Geo3D has a number of distance measurements and a generic way of computing 
> interior distance.  It would be great to take advantage of that for queries 
> that return results ordered by interior distance.



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