You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Karl Wright (JIRA)" <ji...@apache.org> on 2015/05/13 14:45:00 UTC

[jira] [Commented] (LUCENE-6480) Extend Simple GeoPointField Type to 3d

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

Karl Wright commented on LUCENE-6480:
-------------------------------------

So my idea for an (x,y,z) based geohash is as follows:

  - three bits per split iteration: each splits x,y,z into a smaller range
  - initial range for each dimension is -1 to 1, thus size 2.
  - the first split determines the sign, and is thus backwards: e.g. -1 <= x < 0 yields bit 0, 0 <= x <= 1 yields bit 1.
  - second bit splits range, e.g. "00" means -0.5 <= x < 0.

Questions:
  - Q1: how precise is it to fit in a long? A: 64/3 = 21 splits with 1 bit left over.  2/(2^21) = 2^(-20) = 6.07585906982421875 meters
  - Q2: how to quickly convert to a geocode value?
    A: need bit manipulation of mantissa and exponent for this; requires further thought (and maybe a hash change)
  - Q2: how to quickly convert back to usable (x,y,z) from a geocode value?
    A: first, geo3d has to tolerate imprecision in evaluation.  It does, possibly excepting small GeoCircles.  Otherwise, similar bit manipulation of mantissa and exponent in a double.

Once there's a reversible packing method, it's pretty trivial to make use of all geo3d shapes.


> Extend Simple GeoPointField Type to 3d 
> ---------------------------------------
>
>                 Key: LUCENE-6480
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6480
>             Project: Lucene - Core
>          Issue Type: New Feature
>          Components: core/index
>            Reporter: Nicholas Knize
>
> [LUCENE-6450 | https://issues.apache.org/jira/browse/LUCENE-6450] proposes a simple GeoPointField type to lucene core. This field uses 64bit encoding of 2 dimensional points to construct sorted term representations of GeoPoints (aka: GeoHashing).
> This feature investigates adding support for encoding 3 dimensional GeoPoints, either by extending GeoPointField to a Geo3DPointField or adding an additional 3d constructor.



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

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