Commit aaa81d52 authored by Daniel Scheffler's avatar Daniel Scheffler

GeoArray.geotransform.setter: Improved input validation.

parent c4d70219
Pipeline #1305 failed with stages
in 11 minutes and 33 seconds
......@@ -12,8 +12,8 @@ from .masks import CloudMask # noqa: E402
__author__ = """Daniel Scheffler"""
__email__ = 'danschef@gfz-potsdam.de'
__version__ = '0.6.9'
__versionalias__ = 'v20171006.02'
__version__ = '0.6.10'
__versionalias__ = 'v20171010.01'
__all__ = ['GeoArray',
'BadDataMask',
'NoDataMask',
......
......@@ -34,6 +34,7 @@ from py_tools_ds.geo.vector.topology \
from py_tools_ds.geo.vector.geometry import boxObj
from py_tools_ds.io.raster.gdal import get_GDAL_ds_inmem
from py_tools_ds.compatibility.gdal import get_gdal_func
from py_tools_ds.numeric.numbers import is_number
# internal imports
from .subsetting import get_array_at_mapPos
......@@ -240,7 +241,7 @@ class GeoArray(object):
'geotransform must be a list with 6 numbers. Got %s.' % str(gt)
for i in gt:
assert isinstance(i, (int, float)), "geotransform must contain only numbers. Got '%s'." % i
assert is_number(i), "geotransform must contain only numbers. Got '%s' (type: %s)." % (i, type(i))
self._geotransform = gt
......@@ -279,9 +280,9 @@ class GeoArray(object):
return self._projection
elif not self.is_inmem:
self.set_gdalDataset_meta()
return self._projection
return self._projection # or "LOCAL_CS[\"MAP\"]"
else:
return ''
return '' # '"LOCAL_CS[\"MAP\"]"
@projection.setter
def projection(self, prj):
......
......@@ -23,7 +23,7 @@ test_requirements = requirements + ["coverage", "nose", "nose2", "nose-htmloutpu
setup(
name='geoarray',
version='0.6.9',
version='0.6.10',
description="Fast Python interface for geodata - either on disk or in memory.",
long_description=readme + '\n\n' + history,
author="Daniel Scheffler",
......
Markdown is supported
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