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
6a125fe7
Commit
6a125fe7
authored
Oct 18, 2017
by
Daniel Scheffler
Browse files
Fixed invalid polygons. Fixed wrong call within run_gms.sh
Former-commit-id:
550648f5
parent
cded9293
Changes
3
Hide whitespace changes
Inline
Side-by-side
bin/run_gms.sh
View file @
6a125fe7
...
...
@@ -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 @
6a125fe7
...
...
@@ -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 @
6a125fe7
...
...
@@ -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
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