Commit 12324e3b authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Bugfixes

io.raster.GeoArray:
- GeoArray:
     - __init__(): fixed wrong setting of progress attribute
     - reproject_to_new_grid(): fixed missing CPUs keyword

- BadDataMask / NoD
    - set default nodata value to False

- updated __version__
parent a4f7ace9
......@@ -15,7 +15,7 @@ __all__=[#'compatibility',
'similarity',
'GeoArray']
__version__ = '20170201_01'
__version__ = '20170210_01'
__author__='Daniel Scheffler'
# Validate GDAL version
......
......@@ -92,7 +92,7 @@ class GeoArray(object):
self.projection = projection if projection else self.projection
self.bandnames = bandnames if bandnames else list(self.bandnames.values())
self._nodata = nodata if nodata is not None else self._nodata
self.progress = progress if progress else self.progress
self.progress = False if progress is False else self.progress
self.q = q if q is not None else self.q
else:
......@@ -1192,13 +1192,15 @@ class GeoArray(object):
self.mask_nodata.reproject_to_new_grid(prototype = prototype,
tgt_prj = tgt_prj,
tgt_xygrid = tgt_xygrid,
rspAlg = 'near')
rspAlg = 'near',
CPUs = CPUs)
if hasattr(self, '_mask_baddata') and self._mask_baddata is not None:
self.mask_baddata.reproject_to_new_grid(prototype = prototype,
tgt_prj = tgt_prj,
tgt_xygrid = tgt_xygrid,
rspAlg = 'near')
rspAlg = 'near',
CPUs = CPUs)
def read_pointData(self, mapXY_points, mapXY_points_prj=None, band=None):
......@@ -1278,7 +1280,7 @@ class GeoArray(object):
class BadDataMask(GeoArray):
def __init__(self, path_or_array, geotransform=None, projection=None, bandnames=None, nodata=None, progress=True,
def __init__(self, path_or_array, geotransform=None, projection=None, bandnames=None, nodata=False, progress=True,
q=False):
super(BadDataMask, self).__init__(path_or_array, geotransform=geotransform, projection=projection,
......@@ -1315,11 +1317,11 @@ class BadDataMask(GeoArray):
class NoDataMask(GeoArray):
def __init__(self, path_or_array, geotransform=None, projection=None, bandnames=None, nodata=None, progress=True,
def __init__(self, path_or_array, geotransform=None, projection=None, bandnames=None, nodata=False, progress=True,
q=False):
super(NoDataMask, self).__init__(path_or_array, geotransform=geotransform, projection=projection,
bandnames=bandnames, nodata=nodata, progress=progress, q=q)
bandnames=bandnames, nodata=nodata, progress=progress, q=q)
if self.is_inmem:
# validate input data - before converting to bool
......@@ -1327,10 +1329,7 @@ class NoDataMask(GeoArray):
self.arr = self.arr.astype(np.bool)
# del self._mask_nodata, self.mask_nodata # TODO delete property (requires deleter)
# TODO check that: "Automatically detected nodata value for NoDataMask 'IN_MEM': 1.0"
# TODO disk-mode: init must check the numbers of bands, and ideally also the pixel values in mask
# TODO nodata=False?
@property
......
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