Open christophelebrun opened 3 years ago
Polar polygons need special handling. If those can occur use function ispolar
to check first.
from pygeodesy import ispolar
print(ispolar(poly_latlon)) # returns True
Polygons wrapping around the earth longitudinally are troublesome as well, as in poly_latlon[2].lon
-174.32.. to poly_latlon[3].lon
150.33..
The boundsOf
and the .overlap
results above are correct. The issue is the .isenclosedBy
result. Try
square_latlon[0].isenclosedBy(poly_latlon) and not ispolar(poly_latlon)
or
from pygeodesy import isenclosedBy
isenclosedBy(square_latlon[0], poly_latlon, wrap=True)
The latter can be used with any LatLon
class, even with pygeodesy.LatLon_
, which is intended for use with x-y functions like clipSH
, isenclosedBy
, ispolar
, etc.
Hello,
There seems to be a problem with the boundsOf function. I guess it occurs when one of the pole is included in the polygon.
Here is a snippet to figure out the problem: