[ https://issues.apache.org/jira/browse/LUCENE-8276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16453597#comment-16453597 ]
Karl Wright commented on LUCENE-8276: ------------------------------------- [~ivera] I have committed the restructuring, but not any of your patches, so far. The basic idea now is: (1) There are two test points. (2) isWithin() tries the first one initially. If it gets an IllegalArgumentException, it tries the second one. I have made no changes to the logic for deciding which travel legs to use; I am expecting you to add that. Also, I've removed DualCrossingEdgeIterator entirely, in favor of just using the linear edge iterators repeatedly. So we now find whether the intersection point is in-set first, and then we find whether the check point is in set second. This allows travel of a full 180 degrees, so you can reach the antipodes now. I still would like to do some optimizations in the remaining edge iterators, but that should not collide with anything you want to do to address the strategy of choosing travel planes. I would also hope you can commit your test changes that exercise the particular cases that were a problem before, if they pass. > GeoComplexPolygon failures > -------------------------- > > Key: LUCENE-8276 > URL: https://issues.apache.org/jira/browse/LUCENE-8276 > Project: Lucene - Core > Issue Type: Bug > Components: modules/spatial3d > Reporter: Ignacio Vera > Assignee: Ignacio Vera > Priority: Major > Attachments: LUCENE-8276-random.patch, LUCENE-8276-test.patch, > LUCENE-8276.patch > > > I have tightened a bit more the random test for polygons and > GeoComplexPolygons still shows issues when traveling planes that are cutting > the world near the pole. I could identify three cases: > > case 1) It happens when the check point is on aone of the test point planes > but the planes is close to the pole and cannot be traversed. In that case we > hit the following part of the code: > {code:java} > } else if (testPointFixedYPlane.evaluateIsZero(x, y, z) || > testPointFixedXPlane.evaluateIsZero(x, y, z) || > testPointFixedZPlane.evaluateIsZero(x, y, z)) { > throw new IllegalArgumentException("Can't compute isWithin for specified > point"); > } else {{code} > > It seems this check is unnecesary. If removed then a traversal is choosen and > evrything works as expected. > > case 2) In this case a {{DualCrossingEdgeIterator}} is used with one of the > planes being close to the pole but inside current restricutions (is a valid > traversal). I think the problem happens when computing the intersection > points for above and below plane in {{computeInsideOutside}}: > {code:java} > final GeoPoint[] outsideOutsidePoints = > testPointOutsidePlane.findIntersections(planetModel, travelOutsidePlane); > //these don't add anything: , checkPointCutoffPlane, testPointCutoffPlane); > final GeoPoint outsideOutsidePoint = > pickProximate(outsideOutsidePoints);{code} > The intersection above results in two points close to each other and close to > the intersection point, and therefore {{pickProximate}} fails in choosing the > right one. > case 3) In this case a {{LinearCrossingEdgeIterator}} is used with the plane > being close to the pole. In this case when evaluating the intersection > between an edge and the plane, we get two intersections (because are very > close together) inside the bounds instead of one. The result is too many > crossings. > > After evaluating this errors I think we should really prevent using planes > that are near a pole. I attached a new version of {{GeoComplexPolygon}} that > seems to solve this issues. The approach is the following: > {{NEAR_EDGE_CUTOFF}} is not expressed as a linear distance but as a > percentage, curerntly 0.75 . If ab is the value of a semiaxis, the logic > disallows to travel a plane if the distance between the plane and the center > of the world is bigger that {{NEAR_EDGE_CUTOFF}} * pole. > > > > > > > > -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org