Javier,
But the second and third I would expect if (W == -180.0 && E == 180.0) { return true; }if (oW == -180.0 && oE == 180.0) { return true; }if it covers the whole planet (from -180 to 180) it clearly intersects, right? Or am I missing something? (after is passes the first if statement on N-S)
This is mostly for symmetry with the intersection() method that needs to deal specifically with that case where the other bounding box crosses the antimeridian. For normal cases, for intersects(), we could remove that extra check as you suggested, but when trying to do so, this causes the test added in https://github.com/OSGeo/PROJ/commit/c3c9068b54cc190ce81c1fd7ea8b62aaa4c2af97#diff-076233f62785619274b55e6b0d7e45a7d5a25c019b07046f77c2ad0504f7f92dR289 to fail. This is a edge / non-nominal case that was added when dealing with an issue discovered by ossfuzz. Not sure what the expected result false/true should be for a degenerate bbox with W=E=180. Not that I think it really matters (and I'm not willing to initiate yet another discussion about emptyness, which would be better brought to geos-dev :-) ). The only thing that matters here is to make sure this doesn't go into infinite recursion in those edge cases.
Comments added in https://github.com/OSGeo/PROJ/pull/4169 -- http://www.spatialys.com My software is free, but my time generally not.
_______________________________________________ PROJ mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/proj
