Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Daniel Scheffler
geoarray
Commits
f930d2bc
Commit
f930d2bc
authored
Mar 29, 2019
by
Daniel Scheffler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed linting.
parent
950d94f8
Pipeline
#3849
passed with stages
in 1 minute and 23 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
geoarray/baseclasses.py
geoarray/baseclasses.py
+9
-6
geoarray/metadata.py
geoarray/metadata.py
+1
-1
No files found.
geoarray/baseclasses.py
View file @
f930d2bc
...
...
@@ -52,14 +52,17 @@ __author__ = 'Daniel Scheffler'
class
GeoArray
(
object
):
"""
This class creates a fast Python interface for geodata - either on disk or in memory. It can be instanced
with a file path or with a numpy array and the corresponding geoinformation. Instances can always be indexed
like normal numpy arrays, no matter if GeoArray has been instanced from file or from an in-memory array.
GeoArray provides a wide range of geo-related attributes belonging to the dataset as well as some functions for
quickly visualizing the data as a map, a simple image or an interactive image.
"""
def
__init__
(
self
,
path_or_array
,
geotransform
=
None
,
projection
=
None
,
bandnames
=
None
,
nodata
=
None
,
progress
=
True
,
q
=
False
):
# type: (Union[str, np.ndarray], tuple, str, list, float, bool, bool) -> None
"""This class creates a fast Python interface for geodata - either on disk or in memory. It can be instanced with
a file path or with a numpy array and the corresponding geoinformation. Instances can always be indexed like
normal numpy arrays, no matter if GeoArray has been instanced from file or from an in-memory array. GeoArray
provides a wide range of geo-related attributes belonging to the dataset as well as some functions for quickly
visualizing the data as a map, a simple image or an interactive image.
"""Get an instance of GeoArray.
:param path_or_array: a numpy.ndarray or a valid file path
:param geotransform: GDAL geotransform of the given array or file on disk
...
...
@@ -1511,7 +1514,7 @@ class GeoArray(object):
def
get_subset
(
self
,
xslice
=
None
,
yslice
=
None
,
zslice
=
None
,
return_GeoArray
=
True
,
reset_bandnames
=
False
):
# type: (slice, slice, slice, bool, bool) -> GeoArray
"""Return
s
a new
instance of GeoArray
representing a subset of the initial one wit respect to given array position.
"""Return a new
GeoArray instance
representing a subset of the initial one wit respect to given array position.
:param xslice: a slice providing the X-position for the subset in the form slice(xstart, xend, xstep)
:param yslice: a slice providing the Y-position for the subset in the form slice(ystart, yend, ystep)
...
...
geoarray/metadata.py
View file @
f930d2bc
...
...
@@ -196,7 +196,7 @@ class GDAL_Metadata(object):
def
to_ENVI_metadict
(
self
):
return
OrderedDict
(
zip
(
self
.
all_meta
.
keys
(),
[
self
.
_convert_param_to_ENVI_str
(
i
)
for
i
in
self
.
all_meta
.
values
()]))
[
self
.
_convert_param_to_ENVI_str
(
i
)
for
i
in
self
.
all_meta
.
values
()]))
def
get_subset
(
self
,
bands2extract
=
None
,
keys2extract
=
None
):
# type: (Union[slice, list, np.ndarray], Union[str, list]) -> 'GDAL_Metadata'
...
...
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