Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
geomultisens
gms_preprocessing
Commits
550648f5
Commit
550648f5
authored
Oct 18, 2017
by
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
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bin/run_gms.sh
View file @
550648f5
...
...
@@ -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
"
$@
"
gms_preprocessing/misc/helper_functions.py
View file @
550648f5
...
...
@@ -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
):
...
...
gms_preprocessing/misc/spatial_index_mediator.py
View file @
550648f5
...
...
@@ -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
Daniel Scheffler
@danschef
mentioned in commit
6a125fe7
·
Feb 06, 2018
mentioned in commit
6a125fe7
mentioned in commit 6a125fe7d2ddbc995a7d954a242e2b0d82bb5847
Toggle commit list
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment