Skip to content
Snippets Groups Projects
Commit 05d83a0e authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fixed linting.

parent 1448fe50
Branches
Tags
1 merge request!5Bugfix/implement pyresample changes
......@@ -15,7 +15,7 @@ __author__ = "Daniel Scheffler"
def get_overlap_polygon(poly1, poly2, v=False):
""" Returns a dict with the overlap of two shapely.Polygon() objects, the overlap percentage and the overlap area.
""" Return a dict with the overlap of two shapely.Polygon() objects, the overlap percentage and the overlap area.
:param poly1: first shapely.Polygon() object
:param poly2: second shapely.Polygon() object
......@@ -46,7 +46,8 @@ def get_overlap_polygon(poly1, poly2, v=False):
def get_footprint_polygon(CornerLonLat, fix_invalid=False):
""" Converts a list of coordinates into a shapely polygon object.
""" Convert a list of coordinates into a shapely polygon object.
:param CornerLonLat: a list of coordinate tuples like [[lon,lat], [lon. lat], ..]
in clockwise or counter clockwise order
:param fix_invalid: fix invalid output polygon by returning its convex hull (somtimes this can be different)
......@@ -69,7 +70,7 @@ def get_footprint_polygon(CornerLonLat, fix_invalid=False):
def get_smallest_boxImYX_that_contains_boxMapYX(box_mapYX, gt_im, tolerance_ndigits=5):
"""Returns image coordinates of the smallest box at the given coordinate grid that contains the given map coords box.
"""Return image coordinates of the smallest box at the given coordinate grid that contains the given map coords box.
:param box_mapYX: input box ccordinates as YX-tuples
:param gt_im: geotransform of input box
......@@ -96,7 +97,7 @@ def get_largest_onGridPoly_within_poly(outerPoly, gt, rows, cols):
def get_smallest_shapelyImPolyOnGrid_that_contains_shapelyImPoly(shapelyPoly):
"""Returns the smallest box that matches the coordinate grid of the given geotransform.
"""Return the smallest box that matches the coordinate grid of the given geotransform.
The returned shapely polygon contains image coordinates."""
xmin, ymin, xmax, ymax = shapelyPoly.bounds # image_coords-bounds
......@@ -118,7 +119,7 @@ def find_line_intersection_point(line1, line2):
def polyVertices_outside_poly(inner_poly, outer_poly):
"""Checks if a shapely polygon (inner_poly) contains vertices that do not intersect another polygon (outer_poly)
"""Check if a shapely polygon (inner_poly) contains vertices that do not intersect another polygon (outer_poly)
:param inner_poly: the polygon with the vertices to check
:param outer_poly: the polygon where all vertices have to be inside
......@@ -138,7 +139,7 @@ def polyVertices_outside_poly(inner_poly, outer_poly):
def fill_holes_within_poly(poly):
# type: (Union[Polygon, MultiPolygon]) -> Polygon
"""Fills the holes within a shapely Polygon or MultiPolygon and returns a Polygon with only the outer boundary.
"""Fill the holes within a shapely Polygon or MultiPolygon and returns a Polygon with only the outer boundary.
:param poly: <shapely.geometry.Polygon, shapely.geometry.MultiPolygon>, shapely.geometry.GeometryCollection>
:return:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment