[jira] [Commented] (LUCENE-8080) GeoExactCircle improvement

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[jira] [Commented] (LUCENE-8080) GeoExactCircle improvement

JIRA jira@apache.org

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

Karl Wright commented on LUCENE-8080:

Ok, thanks for the fixed patch, [~ivera].

But now I've been thinking about this further.  Can you try to explain to me why the sector approach fails?  Intuitively, it can only fail if it means that a plane is constructed that doesn't accurately capture the points on the planet surface that belong to that sector.  I'm not convinced this can actually occur unless the plane slices through the world in such a way to not go between the circle center's antipode and the center of the circle.  It occurs to me that it should be easy to detect if that is the case:

if (plane.isWithin(-center.x, -center.y, -center.z) == plane.isWithin(center.x, ,center.y, center.z)) {
  // plane is bogus

The question is, what to do if that's the case?  I would think that, for a bad sector, just splitting the sector further might consistently solve the problem.  Why doesn't it?  Maybe the plane is so tilted within its sector that even the above test is inadequate somehow?  Is there any way to determine if the plane excludes points on the surface that are otherwise within the sector planes?  Or maybe the problem is a bit more subtle?

We've iterated on this a number of times so I think we need to think it through enough to be sure we have a decent fix here.

> GeoExactCircle improvement
> --------------------------
>                 Key: LUCENE-8080
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8080
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/spatial3d
>            Reporter: Ignacio Vera
>            Assignee: Karl Wright
>         Attachments: LUCENE-8080-test.patch, LUCENE-8080.patch
> Hi [~daddywri],
> Current implementation of GeoExactCircle seems to work well for planet models with low flattening (~|0.025|). When flattening increase shapes start becoming invalid because of the cutting angle of the circle plane which results on the center of the circle ending up on the wrong side of the plane.
> I propose a new version of GeoExactCircle that tries to overcome this problem by creating a new plane for a circle sector in such cases. The new plane is built built for each sector when needed by using two points from the circle edge and the center of the world. The plane is such that it is built as close as possible to the circle plane of the sector. Points from the circle plane must not be within the new plane and the center of the circle must be within the plane.
> This approach seems to work well up to planets with flattening up to around ~|0.1|. I think after that the cutting angles of circle planes can be so thin that the apporach is not valid.
> Therefore I propose to add this new approach and limit the creation of such circles to planet models with flattening lower than |0.1|. Probably a limitation that does not affect most of the realistic cases.
> In addition this new version forces a minimum of 4 sectors in a circle. The issue on LUCENE-8071 came up again for circles of any radius so we should enforce it for all circles.
> Thanks!

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]