The methods __contains__, overlaps, overlap_rate, intersection, contains, get_area implemented in BaseDefinition class employs a polygon defined by the centroid of the pixel corners of the SwathDef / AreaDef to perform the geometrical computations.
While this works correctly for many classical AreaDefinition, for:
Geostationary AreaDef all methods crash (because of Inf values at the corners) (see also #393, #268) 3https://github.com/pytroll/pyresample/issues/393
SwathDefinition, the corners of lats/lons arrays does not provide meaningful values in the case of ascending and descending orbits within SwathDefinition ...
Problem description
The methods
__contains__
,overlaps
,overlap_rate
,intersection
,contains
,get_area
implemented in BaseDefinition class employs a polygon defined by the centroid of the pixel corners of the SwathDef / AreaDef to perform the geometrical computations. While this works correctly for many classical AreaDefinition, for:Code example for GEO AreaDef
Proposed solution:
boundary
method for SwathDefinition and AreaDefinition to retrieveAreaBoundary
classSphPolygon
fromAreaBoundary
usingself.polygon()
BaseDefinition
methods to useself.boundary().polygon().<method>(...)
Draft PR coming in the next days ...