Exemple #1
0
 def intersection(self, other):
     """Returns the corners of the intersection polygon of the current area
     with *other*.
     
     :Parameters:
     other : object
         Instance of subclass of BaseDefinition
         
     :Returns:
     (corner1, corner2, corner3, corner4) : tuple of points
     """
     from pyresample.spherical_geometry import intersection_polygon
     return intersection_polygon(self.corners, other.corners)
Exemple #2
0
    def intersection(self, other):
        """Returns the corners of the intersection polygon of the current area
        with *other*.

        :Parameters:
        other : object
            Instance of subclass of BaseDefinition

        :Returns:
        (corner1, corner2, corner3, corner4) : tuple of points
        """
        from pyresample.spherical_geometry import intersection_polygon
        return intersection_polygon(self.corners, other.corners)
Exemple #3
0
    def intersection(self, other):
        """Returns the corners of the intersection polygon of the current area
        with *other*, allowing for potentially masked data in the corners.

        :Parameters:
        other : object
            Instance of subclass of BaseDefinition

        :Returns:
        (corner1, corner2, corner3, corner4) : tuple of points
        """
        from pyresample.spherical_geometry import intersection_polygon
        # This was failing if all the corners of the
        #       area_definition fell inside the data box definition.
        #       watch for false positives
        # This DOES NOT WORK for over the pole...
        retcorners = intersection_polygon(self.corners, other.corners)
        allselfcornersin = False
        allothercornersin = False
        if not retcorners:
            # Only try these if intersection_polygon didn't return anything.
            for i in self.corners:
                if planar_point_inside(i, other.corners):
                    allselfcornersin = True
                else:
                    allselfcornersin = False
            for i in other.corners:
                if planar_point_inside(i, self.corners):
                    allothercornersin = True
                else:
                    allothercornersin = False

            if allselfcornersin:
                return self.corners
            if allothercornersin:
                return other.corners
        return retcorners