Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
py_tools_ds
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Daniel Scheffler
py_tools_ds
Commits
05d83a0e
Commit
05d83a0e
authored
6 years ago
by
Daniel Scheffler
Browse files
Options
Downloads
Patches
Plain Diff
Fixed linting.
parent
1448fe50
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!5
Bugfix/implement pyresample changes
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
py_tools_ds/geo/vector/topology.py
+7
-6
7 additions, 6 deletions
py_tools_ds/geo/vector/topology.py
with
7 additions
and
6 deletions
py_tools_ds/geo/vector/topology.py
+
7
−
6
View file @
05d83a0e
...
...
@@ -15,7 +15,7 @@ __author__ = "Daniel Scheffler"
def
get_overlap_polygon
(
poly1
,
poly2
,
v
=
False
):
"""
Return
s
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
):
"""
Return
s
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
):
"""
Return
s
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
):
"""
Check
s
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
"""
Fill
s
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:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment