def get_area(self): """Get the area of the convex area defined by the corners of the current area. """ from pyresample.spherical_geometry import get_polygon_area return get_polygon_area(self.corners)
def overlap_rate(self, other): """Get how much the current area overlaps an *other* area. :Parameters: other : object Instance of subclass of BaseDefinition :Returns: overlap_rate : float """ from pyresample.spherical_geometry import get_polygon_area other_area = other.get_area() inter_area = get_polygon_area(self.intersection(other)) return inter_area / other_area