[
https://issues.apache.org/jira/browse/LUCENE-7186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15243346#comment-15243346
]
Michael McCandless commented on LUCENE-7186:
--------------------------------------------
This comment confuses me :) And I think because we are making core changes
here, we really should spend the time to make things as understandable as we
can:
{noformat}
+ // translates quantized values from range starting at Integer.MIN_VALUE to 0
+ // once interleaved this represents a quad tree space from 000 ... FFF such
+ // that DFS traversal is achieved through bit masking
+ private static final long TRANSLATE = 1L << 31;
{noformat}
I'm asking again :) Isn't this just doing the same thing as the xor of the
sign bit that {{NumericUtils}} does? If so, I think the xor (and the comment
Uwe wrote above it!) is cleaner?
Stepping back ... why are we adding this API to Lucene's core APIs now? If I
understand correctly, it's only {{GeoPointField}} (with its 31 bit encoding
that we want to move up to 32 bits, using the same encoding as {{LatLonPoint}})
that needs to use it, now? Can this instead remain in the spatial module, and
only later, once we have a 1D points based morton encoded geo field, can we
then think about making these available in core?
I think, if we see at least 3 of the 4 spatial modules needing a common API, it
makes sense to have it in core ... this is why we e.g. added {{Rectangle}} and
{{Polygon}}, and {{checkLatitude/Longitude}}, but if it's only 1 of the 4, I
think that one module should keep that API package private?
> Add numerically stable morton encoding to GeoEncodingUtils
> ----------------------------------------------------------
>
> Key: LUCENE-7186
> URL: https://issues.apache.org/jira/browse/LUCENE-7186
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Nicholas Knize
> Attachments: LUCENE-7186.patch, LUCENE-7186.patch, LUCENE-7186.patch,
> LUCENE-7186.patch
>
>
> This is the follow on to LUCENE-7184. It adds a numerically stable morton
> encoding method to {{o.a.l.geo.GeoEncodingUtils}} that can be reused by
> {{GeoPointField}} and a new {{GeoPointField}} based on {{Point}} encoding.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]