iverase opened a new pull request, #804: URL: https://github.com/apache/lucene/pull/804
In spatial3d in order to built a bounding box we need to check the provided values and decide which kind of structure we need to build depending on the characteristics of the bounding box. One of this characteristics is when the min latitude and max latitude are the same. In that case we might build a `GeoDegenerateVerticalLine` or a `GeoDegeneratePoint` if the min and max longitudes are the same. Trying to build a `GeoRectangle` with the same min and max latitude results in an error as we cannot compute the sidedness for the vertical planes. In order to decide if the min and max latitude are equal we need to account for numerical errors when building the planes. We currently consider that two angular magnitudes are equivalent if the distance between them is lower than the `MINIMUM_ANGULAR_RESOLUTION`. Unfortunately this is not enough as it might happen that two latitudes at bigger distance produce the same planes and therefore it makes the logic fail. This PR adds an extra check to make sure that if we have min max latitudes that resolve in the same planes, we build one of our specialised structures. The new test showed as well, that sometimes even when we re able to build our planes we fail because we use the center of those planes to check for sidedness. When they are too close, it might happen that the center of those planes is on top of one of the planes due to numerical errors, resulting in an error. This PR uses points from the bounding box instead of the center to check for sidedness. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org