[
https://issues.apache.org/jira/browse/LUCENE-8066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16265809#comment-16265809
]
Karl Wright commented on LUCENE-8066:
-------------------------------------
Looking at the "isWithin" code here:
{code}
@Override
public boolean isWithin(final double x, final double y, final double z) {
- if (circlePlanes == null) {
+ if (circleSlices.size() == 0) {
return true;
}
- for (final Membership plane : circlePlanes) {
- final Membership backPlane =
(backBounds==null)?null:backBounds.get(plane);
- if (backPlane == null || backPlane.isWithin(x, y, z)) {
- if (!plane.isWithin(x, y, z)) {
- return false;
- }
- }
- }
- return true;
+ for (final CircleSlice slice : circleSlices) {
+ if (slice.circlePlane.isWithin(x, y, z) && slice.plane1.isWithin(x, y,
z) && slice.plane2.isWithin(x, y, z)) {
+ return true;
+ }
+ }
+ return false;
}
{code}
Basically, the circle is divided into sectors. The sector edges must go
through the center of the circle and the center of the world. The potential
problems come in because each sector meets the line from the circle center to
the center of the world at a different point. As long as that point is not
actually *outside* of the world, though, that is fine, since we're describing a
Geo shape that resides on the surface of the world, not underneath.
So I see how this works and I agree that it is an improvement, although I also
think we will need to have code that detects when we're building sectors that
are illegal.
> Another approach to Exact circle
> --------------------------------
>
> Key: LUCENE-8066
> URL: https://issues.apache.org/jira/browse/LUCENE-8066
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Ignacio Vera
> Attachments: LUCENE-8066.patch
>
>
> Hi [~daddywri],
> I was thinking in the limitation of convexity for circle planes and I worked
> out another approach that overcome this limitation. There is a condition,
> circle lanes must contain the center of the circle which is probably always
> true for planets like WGS84 which are not too far from the sphere.
> The idea is create a short of polygon for every slice using the center of the
> circle (like an orange) and therefore you can treat them separately. I
> attached what I developed, it seems to pass all tests regardless of the
> radius.
> Let me know what you think and if I am missing something.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]