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
bbb2622b
Commit
bbb2622b
authored
Sep 10, 2018
by
Daniel Scheffler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added parameter 'ax' to GeoArray.show().
parent
584ab3ef
Pipeline
#3189
passed with stages
in 1 minute and 25 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
geoarray/baseclasses.py
geoarray/baseclasses.py
+9
-5
No files found.
geoarray/baseclasses.py
View file @
bbb2622b
...
...
@@ -1031,7 +1031,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
):
res_factor
=
None
,
interactive
=
False
,
ax
=
None
):
"""Plots the desired array position into a figure.
:param xlim: [start_column, end_column]
...
...
@@ -1052,6 +1052,7 @@ class GeoArray(object):
plotting time and memory (default=None -> downsampling is performed to 1000x1000)
: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
:return:
"""
...
...
@@ -1112,10 +1113,13 @@ class GeoArray(object):
'Switching to standard matplotlib figure..'
)
# TODO implement zoomable fig
# show image
plt
.
figure
(
figsize
=
figsize
)
if
not
ax
:
plt
.
figure
(
figsize
=
figsize
)
ax
=
plt
.
gca
()
rows
,
cols
=
image2plot
.
shape
[:
2
]
plt
.
imshow
(
image2plot
,
palette
,
interpolation
=
interpolation
,
extent
=
(
0
,
cols
,
rows
,
0
),
vmin
=
vmin
,
vmax
=
vmax
,
)
# compressed excludes nodata values
ax
.
imshow
(
image2plot
,
palette
,
interpolation
=
interpolation
,
extent
=
(
0
,
cols
,
rows
,
0
),
vmin
=
vmin
,
vmax
=
vmax
,
)
# compressed excludes nodata values
plt
.
show
()
def
show_map
(
self
,
xlim
=
None
,
ylim
=
None
,
band
=
0
,
boundsMap
=
None
,
boundsMapPrj
=
None
,
ax
=
None
,
figsize
=
None
,
...
...
@@ -1355,11 +1359,11 @@ class GeoArray(object):
self
.
clip_to_poly
(
self
.
footprint_poly
)
def
clip_to_poly
(
self
,
poly
):
# type: (Polygon) -> None
"""Clip the GeoArray instance to the outer bounds of a given shapely polygon.
:param poly: instance of shapely.geometry.Polygon
"""
# type: Polygon -> None
self
.
arr
,
self
.
gt
,
self
.
projection
=
self
.
get_mapPos
(
mapBounds
=
poly
.
bounds
,
mapBounds_prj
=
self
.
prj
)
self
.
mask_nodata
.
arr
,
self
.
mask_nodata
.
gt
,
self
.
mask_nodata
.
projection
=
\
self
.
mask_nodata
.
get_mapPos
(
mapBounds
=
poly
.
bounds
,
mapBounds_prj
=
self
.
prj
)
...
...
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