Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
geoarray
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Daniel Scheffler
geoarray
Commits
3cfd9a28
Commit
3cfd9a28
authored
May 14, 2019
by
Daniel Scheffler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added ignore_rotation to GeoArray.show(). Updated version info.
Signed-off-by:
Daniel Scheffler
<
danschef@gfz-potsdam.de
>
parent
d3ec31a5
Pipeline
#3962
passed with stages
in 14 minutes and 10 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
geoarray/baseclasses.py
geoarray/baseclasses.py
+6
-4
geoarray/version.py
geoarray/version.py
+2
-2
No files found.
geoarray/baseclasses.py
View file @
3cfd9a28
...
...
@@ -1043,7 +1043,7 @@ class GeoArray(object):
dill
.
dump
(
self
,
outF
)
def
_get_plottable_image
(
self
,
xlim
=
None
,
ylim
=
None
,
band
=
None
,
boundsMap
=
None
,
boundsMapPrj
=
None
,
res_factor
=
None
,
nodataVal
=
None
,
out_prj
=
None
):
nodataVal
=
None
,
out_prj
=
None
,
ignore_rotation
=
False
):
# handle limits
if
boundsMap
:
boundsMapPrj
=
boundsMapPrj
if
boundsMapPrj
else
self
.
prj
...
...
@@ -1064,7 +1064,7 @@ class GeoArray(object):
image2plot
=
image2plot
.
astype
(
np
.
int32
)
# rotated images always have to be resampled for plotting
if
gt
[
2
]
or
gt
[
4
]:
if
not
ignore_rotation
and
gt
[
2
]
or
gt
[
4
]:
out_prj
=
out_prj
or
self
.
projection
if
res_factor
!=
1.
and
image2plot
.
shape
[
0
]
*
image2plot
.
shape
[
1
]
>
1e6
:
# shape > 1000*1000
...
...
@@ -1095,7 +1095,7 @@ class GeoArray(object):
def
show
(
self
,
xlim
=
None
,
ylim
=
None
,
band
=
None
,
boundsMap
=
None
,
boundsMapPrj
=
None
,
figsize
=
None
,
interpolation
=
'none'
,
vmin
=
None
,
vmax
=
None
,
pmin
=
2
,
pmax
=
98
,
cmap
=
None
,
nodataVal
=
None
,
res_factor
=
None
,
interactive
=
False
,
ax
=
None
):
res_factor
=
None
,
interactive
=
False
,
ax
=
None
,
ignore_rotation
=
False
):
"""Plots the desired array position into a figure.
:param xlim: [start_column, end_column]
...
...
@@ -1117,6 +1117,8 @@ class GeoArray(object):
:param interactive: <bool> activates interactive plotting based on 'holoviews' library.
NOTE: this deactivates the magic '% matplotlib inline' in Jupyter Notebook
:param ax: <matplotlib.axis> only usable in non-interactive mode
:param ignore_rotation: whether to ignore an image rotation angle included in the GDAL GeoTransform tuple for
plotting (default: False)
:return:
"""
...
...
@@ -1126,7 +1128,7 @@ class GeoArray(object):
nodataVal
=
nodataVal
if
nodataVal
is
not
None
else
self
.
nodata
if
self
.
nodata
is
not
None
else
-
9999
image2plot
,
gt
,
prj
=
\
self
.
_get_plottable_image
(
xlim
,
ylim
,
band
,
boundsMap
=
boundsMap
,
boundsMapPrj
=
boundsMapPrj
,
res_factor
=
res_factor
,
nodataVal
=
nodataVal
)
res_factor
=
res_factor
,
nodataVal
=
nodataVal
,
ignore_rotation
=
ignore_rotation
)
# set color palette
palette
=
plt
.
get_cmap
(
cmap
)
if
cmap
and
isinstance
(
cmap
,
str
)
else
cmap
if
cmap
else
plt
.
get_cmap
(
'gray'
)
...
...
geoarray/version.py
View file @
3cfd9a28
__version__
=
'0.8.1
7
'
__versionalias__
=
'2019051
0
.01'
__version__
=
'0.8.1
8
'
__versionalias__
=
'2019051
4
.01'
Write
Preview
Markdown
is supported
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