Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
py_tools_ds
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Daniel Scheffler
py_tools_ds
Commits
fb8e69db
There was a problem fetching the pipeline summary.
Commit
fb8e69db
authored
7 years ago
by
Daniel Scheffler
Browse files
Options
Downloads
Patches
Plain Diff
Allowed tuple objects to be passed to warp_ndarray().
parent
9ca01bad
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
py_tools_ds/geo/raster/reproject.py
+5
-5
5 additions, 5 deletions
py_tools_ds/geo/raster/reproject.py
with
5 additions
and
5 deletions
py_tools_ds/geo/raster/reproject.py
+
5
−
5
View file @
fb8e69db
...
...
@@ -295,12 +295,12 @@ def warp_ndarray(ndarray, in_gt, in_prj=None, out_prj=None, out_dtype=None,
"'
cubic
'
is used instead. To avoid this please update GDAL to a version above 2.0.0!
"
)
rspAlg
=
'
cubic
'
if
not
isinstance
(
ndarray
,
list
):
if
not
isinstance
(
ndarray
,
(
list
,
tuple
)
):
assert
str
(
np
.
dtype
(
ndarray
.
dtype
))
in
dTypeDic_NumPy2GDAL
,
"
Unknown target datatype
'
%s
'
.
"
%
ndarray
.
dtype
else
:
assert
str
(
np
.
dtype
(
ndarray
[
0
].
dtype
))
in
dTypeDic_NumPy2GDAL
,
"
Unknown target datatype
'
%s
'
.
"
%
ndarray
.
dtype
assert
isinstance
(
in_gt
,
list
),
"
If
'
ndarray
'
is a list,
'
in_gt
'
must also be a list!
"
assert
isinstance
(
in_prj
,
list
),
"
If
'
ndarray
'
is a list,
'
in_prj
'
must also be a list!
"
assert
isinstance
(
in_gt
,
(
list
,
tuple
)
),
"
If
'
ndarray
'
is a list,
'
in_gt
'
must also be a list!
"
assert
isinstance
(
in_prj
,
(
list
,
tuple
)
),
"
If
'
ndarray
'
is a list,
'
in_prj
'
must also be a list!
"
assert
len
(
list
(
set
([
arr
.
dtype
for
arr
in
ndarray
])))
==
1
,
"
Data types of input ndarray list must be equal.
"
def
get_SRS
(
prjArg
):
...
...
@@ -309,7 +309,7 @@ def warp_ndarray(ndarray, in_gt, in_prj=None, out_prj=None, out_dtype=None,
def
get_GDT
(
DT
):
return
dTypeDic_NumPy2GDAL
[
str
(
np
.
dtype
(
DT
))]
in_dtype_np
=
ndarray
.
dtype
if
not
isinstance
(
ndarray
,
list
)
else
ndarray
[
0
].
dtype
in_dtype_np
=
ndarray
.
dtype
if
not
isinstance
(
ndarray
,
(
list
,
tuple
)
)
else
ndarray
[
0
].
dtype
# # not yet implemented
# # TODO cutline from OGR datasource. => implement input shapefile or Geopandas dataframe
...
...
@@ -394,7 +394,7 @@ def warp_ndarray(ndarray, in_gt, in_prj=None, out_prj=None, out_dtype=None,
"""
# get input dataset (in-MEM)
if
not
isinstance
(
ndarray
,
list
):
if
not
isinstance
(
ndarray
,
(
list
,
tuple
)
):
in_ds
=
get_GDAL_ds_inmem
(
ndarray
,
in_gt
,
in_prj
)
else
:
# list of ndarrays
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment