Skip to content
GitLab
Menu
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
6543234b
Commit
6543234b
authored
Mar 30, 2020
by
Daniel Scheffler
Browse files
Revised previous commit.
Signed-off-by:
Daniel Scheffler
<
danschef@gfz-potsdam.de
>
parent
26034202
Pipeline
#8004
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
gms_preprocessing/model/metadata.py
View file @
6543234b
...
...
@@ -882,26 +882,22 @@ class METADATA(object):
# Coordinate Reference System
re_CS_EPSG
=
re
.
search
(
r
'<re:ProductInformation>[\s\S]*'
r
'<re:epsgCode>([0-9]*)'
r
'</re:epsgCode>[\s\S]*'
'</re:ProductInformation>'
,
r
'<re:epsgCode>([0-9]*)</re:epsgCode>[\s\S]*'
r
'</re:ProductInformation>'
,
mxml_
,
re
.
I
)
re_CS_TYPE
=
re
.
search
(
r
'<re:ProductInformation>[\s\S]*'
r
'<re:projection>([\s\S]*)'
r
'</re:projection>[\s\S]*'
'</re:ProductInformation>'
,
r
'<re:projection>([\s\S]*)</re:projection>[\s\S]*'
r
'</re:ProductInformation>'
,
mxml_
,
re
.
I
)
re_CS_DATUM
=
re
.
search
(
r
'<re:ProductInformation>[\s\S]*'
r
'<re:geodeticDatum>([\w+\s]*)'
r
'</re:geodeticDatum>[\s\S]*'
'</re:ProductInformation>'
,
r
'<re:geodeticDatum>([\w+\s]*)</re:geodeticDatum>[\s\S]*'
r
'</re:ProductInformation>'
,
mxml_
,
re
.
I
)
re_CS_UTM_ZONE
=
re
.
search
(
r
'<re:ProductInformation>[\s\S]*'
r
'<re:projectionZone>([0-9]*)'
r
'</re:projectionZone>[\s\S]*'
r
'<re:projectionZone>([0-9]*)</re:projectionZone>[\s\S]*'
r
'</re:ProductInformation>'
,
mxml_
,
re
.
I
)
self
.
CS_EPSG
=
int
(
re_CS_EPSG
.
group
(
1
))
if
re_CS_EPSG
else
self
.
CS_EPSG
...
...
@@ -913,35 +909,27 @@ class METADATA(object):
# Corner Coordinates ## Lon/Lat for all given image corners UL,UR,LL,LR (tuples)
h10_UL
=
re
.
findall
(
r
'<re:topLeft>'
r
'<re:latitude>(.*)'
r
'</re:latitude>'
r
'<re:longitude>(.*)'
r
'</re:longitude>'
r
'<re:latitude>(.*)</re:latitude>'
r
'<re:longitude>(.*)</re:longitude>'
r
'</re:topLeft>'
,
mxml_
,
re
.
I
)
h10_UR
=
re
.
findall
(
'<re:topRight>'
'<re:latitude>(.*)'
'</re:latitude>'
'<re:longitude>(.*)'
'</re:longitude>'
'</re:topRight>'
,
r
'<re:topRight>'
r
'<re:latitude>(.*)</re:latitude>'
r
'<re:longitude>(.*)</re:longitude>'
r
'</re:topRight>'
,
mxml_
,
re
.
I
)
h10_LL
=
re
.
findall
(
'<re:bottomLeft>'
'<re:latitude>(.*)'
'</re:latitude>'
'<re:longitude>(.*)'
'</re:longitude>'
'</re:bottomLeft>'
,
r
'<re:bottomLeft>'
r
'<re:latitude>(.*)</re:latitude>'
r
'<re:longitude>(.*)</re:longitude>'
r
'</re:bottomLeft>'
,
mxml_
,
re
.
I
)
h10_LR
=
re
.
findall
(
'<re:bottomRight>'
'<re:latitude>(.*)'
'</re:latitude>'
'<re:longitude>(.*)'
'</re:longitude>'
'</re:bottomRight>'
,
r
'<re:bottomRight>'
r
'<re:latitude>(.*)</re:latitude>'
r
'<re:longitude>(.*)</re:longitude>'
r
'</re:bottomRight>'
,
mxml_
,
re
.
I
)
if
h10_UL
:
# Set Corner Tie Point Coordinates (order = UL,UR,LL,LR)
self
.
CornerTieP_LonLat
.
append
(
tuple
([
float
(
h10_UL
[
0
][
1
]),
float
(
h10_UL
[
0
][
0
])]))
...
...
@@ -956,8 +944,7 @@ class METADATA(object):
LBA_full_sorted
=
HLP_F
.
sorted_nicely
(
self
.
LayerBandsAssignment_full
)
# Gains + Offsets
h9
=
re
.
findall
(
r
"<re:radiometricScaleFactor>([^<]*)"
r
"</re:radiometricScaleFactor>"
,
h9
=
re
.
findall
(
r
"<re:radiometricScaleFactor>([^<]*)</re:radiometricScaleFactor>"
,
mxml_
,
re
.
I
)
self
.
Gains
=
dict
(
zip
(
LBA_full_sorted
,
[
float
(
gain
)
for
gain
in
h9
]))
self
.
Offsets
=
dict
(
zip
(
LBA_full_sorted
,
[
0
,
0
,
0
,
0
,
0
]))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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