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
Daniel Scheffler
geoarray
Commits
d989962a
Commit
d989962a
authored
Mar 16, 2022
by
Daniel Scheffler
Browse files
Added GeoArray.is_rotated attribute. Bumped version.
parent
24204881
Pipeline
#40196
failed with stage
in 1 minute and 42 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
HISTORY.rst
View file @
d989962a
...
...
@@ -2,6 +2,12 @@
History
=======
0.15.8 (16.03.2022)
-------------------
* Added GeoArray.is_rotated attribute to detect pseudo-projections.
0.15.7 (13.01.2022)
-------------------
...
...
geoarray/baseclasses.py
View file @
d989962a
...
...
@@ -365,12 +365,18 @@ class GeoArray(object):
"""Return 'True' if the image has a valid geoinformation with map instead of image coordinates."""
return
all
([
self
.
gt
,
list
(
self
.
gt
)
!=
[
0
,
1
,
0
,
0
,
0
,
-
1
],
self
.
prj
])
@
property
def
is_rotated
(
self
):
# type: () -> bool
"""Return 'True' if the image has a rotation in the map info (i.e., is pseudo-projected)."""
return
self
.
gt
[
2
]
or
self
.
gt
[
4
]
@
property
def
nodata
(
self
):
"""Get the nodata value of the GeoArray instance.
If GeoArray has been instanced with a file path the metadata of the file on disk is checked for an existing
nodata value. Otherwise (if no value is exlicitly given during object instanciation) an automatic detection
nodata value. Otherwise
,
(if no value is exlicitly given during object instanciation) an automatic detection
based on 3x3 windows at each image corner is run that analyzes the mean and standard deviation of these windows.
"""
if
self
.
_nodata
is
not
None
:
...
...
@@ -1177,7 +1183,7 @@ class GeoArray(object):
image2plot
=
image2plot
.
astype
(
int
)
# rotated images always have to be resampled for plotting
if
not
ignore_rotation
and
(
gt
[
2
]
or
gt
[
4
])
:
if
not
ignore_rotation
and
self
.
is_rotated
:
out_prj
=
out_prj
or
self
.
projection
if
res_factor
!=
1.
and
image2plot
.
shape
[
0
]
*
image2plot
.
shape
[
1
]
>
1e6
:
# shape > 1000*1000
...
...
geoarray/version.py
View file @
d989962a
...
...
@@ -22,5 +22,5 @@
# limitations under the License.
__version__
=
'0.15.
7
'
__versionalias__
=
'20220
113
.01'
__version__
=
'0.15.
8
'
__versionalias__
=
'20220
316
.01'
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