Commit 880962b5 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fixed type issues. Added dummy test.

parent 931e0ba9
Pipeline #3201 passed with stages
in 1 minute and 5 seconds
......@@ -49,7 +49,7 @@ class Geocoding(object):
self.from_geotransform_projection(gt, prj)
def from_geotransform_projection(self, gt, prj):
# type: (Union[list, tuple], str) -> self
# type: (Union[list, tuple], str) -> Geocoding
"""Create Geocoding object from GDAL GeoTransform + WKT projection string.
HOW COMPUTATION OF RADIANTS WORKS:
......@@ -121,13 +121,12 @@ class Geocoding(object):
return self
def from_mapinfo(self, mapinfo):
# type: (Union[list, tuple]) -> self
# type: (Union[list, tuple]) -> Geocoding
"""Create Geocoding object from ENVI map info.
:param mapinfo: ENVI map info, e.g., ['UTM', 1, 1, 192585.0, 5379315.0, 30.0, 30.0, 41, 'North', 'WGS-84']
:return: instance of Geocoding
"""
# type: (Union[list, tuple]) -> self
if mapinfo:
# validate input map info
if not isinstance(mapinfo, (list, tuple)):
......
......@@ -298,7 +298,8 @@ def warp_ndarray(ndarray, in_gt, in_prj=None, out_prj=None, out_dtype=None,
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 str(np.dtype(ndarray[0].dtype)) in dTypeDic_NumPy2GDAL, \
"Unknown target datatype '%s'." % ndarray[0].dtype
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."
......
#!/usr/bin/env python
from unittest import TestCase
class Test_warp_ndarray(TestCase):
def setUp(self):
pass
def test_large_input_raster(self):
pass # TODO
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment