[
https://issues.apache.org/jira/browse/LUCENE-6196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14292995#comment-14292995
]
Karl Wright commented on LUCENE-6196:
-------------------------------------
Unless I made a math error, I get the following for longitude bounds:
{code}
ADx0 + BDy0 - C^2 = 0
{code}
... combined with either:
{code}
[C^2 * D^2 * (B^2 + A^2)] * y0^2
+ [-2*C^4*BD] * y0
+ [C^6 + A^2 * C^4 + A^2 * D^2 * C^2] = 0
x0 = (-BDy0 + C^2) / AD
{code}
... or its counterpart, solving for x0:
{code}
[C^2 * D^2 * (B^2 + A^2)] * x0^2
+ [-2*C^4*BD] * x0
+ [C^6 + B^2 * C^4 + B^2 * D^2 * C^2] = 0
y0 = (-ADx0 + C^2) / BD
{code}
Either way, the minimum or maximum longitude, provided there are any solutions
(x0,y0), is given by:
{code}
longitude = atan(y0/x0)
{code}
So as soon as I confirm this math, I can implement a general bounds solution
for an arbitrary plane intersecting the unit sphere, which should allow me to
provide bounding boxes for all shapes built on 3d bounding planes.
> Include geo3d package, along with Lucene integration to make it useful
> ----------------------------------------------------------------------
>
> Key: LUCENE-6196
> URL: https://issues.apache.org/jira/browse/LUCENE-6196
> Project: Lucene - Core
> Issue Type: New Feature
> Components: modules/spatial
> Reporter: Karl Wright
> Assignee: David Smiley
> Attachments: ShapeImpl.java, geo3d.zip
>
>
> I would like to explore contributing a geo3d package to Lucene. This can be
> used in conjunction with Lucene search, both for generating geohashes (via
> spatial4j) for complex geographic shapes, as well as limiting results
> resulting from those queries to those results within the exact shape in
> highly performant ways.
> The package uses 3d planar geometry to do its magic, which basically limits
> computation necessary to determine membership (once a shape has been
> initialized, of course) to only multiplications and additions, which makes it
> feasible to construct a performant BoostSource-based filter for geographic
> shapes. The math is somewhat more involved when generating geohashes, but is
> still more than fast enough to do a good job.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]