Commit 550648f5 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fixed invalid polygons. Fixed wrong call within run_gms.sh

parent 945bdd34
Pipeline #1393 passed with stage
in 8 minutes and 13 seconds
......@@ -5,4 +5,4 @@
# variable points to the correct Python interpreter.
#ipython --colors='NoColor' run_gms.py jobid "$@" # NoColor must be active for ipython because gwt-log cannot interpret ANSI console colors
python run_gms.py jobid "$@"
run_gms.py jobid "$@"
......@@ -473,13 +473,20 @@ def scene_ID_to_shapelyPolygon(scene_ID):
"""
Returns a LonLat shapely.Polygon() object corresponding to the given scene_ID.
"""
return Polygon(reorder_CornerLonLat(sceneID_to_trueDataCornerLonLat(scene_ID)))
poly = Polygon(reorder_CornerLonLat(sceneID_to_trueDataCornerLonLat(scene_ID)))
if not poly.is_valid:
poly = poly.buffer(0)
assert poly.is_valid
return poly
def CornerLonLat_to_shapelyPoly(CornerLonLat):
"""Returns a shapely.Polygon() object based on the given coordinate list. """
return Polygon(reorder_CornerLonLat(CornerLonLat))
poly = Polygon(reorder_CornerLonLat(CornerLonLat))
if not poly.is_valid:
poly = poly.buffer(0)
assert poly.is_valid
return poly
def find_in_xml_root(namespace, xml_root, branch, *branches, findall=None):
......
......@@ -324,4 +324,10 @@ class Scene:
self.bounds = bounds
tempList = list(bounds) + [None] * 2
self.coordsLonLat = [tempList[n:n + 2] for n in range(0, len(bounds), 2)]
self.polyLonLat = Polygon(self.coordsLonLat)
# set validated (!) polygon
poly = Polygon(self.coordsLonLat)
if not poly.is_valid:
poly = poly.buffer(0)
assert poly.is_valid
self.polyLonLat = poly
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment