Error create Test fraction map

Issue #624 resolved
Benjamin Jakimow created an issue

Creating a test fraction map fails with raise TypeError('unexpected value: {}'.format(resampleAlg)) TypeError: unexpected value: 14 when just using a file name, expecting the data will be written to the QGIS temp folder (as know from other algorithms)

QGIS version: 3.17.0-Master
QGIS code revision: eba9ffa46e
Qt version: 5.11.2
GDAL version: 3.3.0dev
GEOS version: 3.8.1-CAPI-1.13.3
PROJ version: Rel. 8.0.0, March 1st, 2021
Processing algorithm
Algorithm 'Create Test Fraction Map' starting
Input parameters:
{ 'outFraction' : './fraction1.tif' }

Traceback (most recent call last):
File "C:\Users\geo_beja\Repositories\enmap-box\enmapboxgeoalgorithms\provider.py", line 155, in processAlgorithm
result = self.processAlgorithm_()
File "C:\Users\geo_beja\Repositories\enmap-box\enmapboxgeoalgorithms\algorithms.py", line 591, in processAlgorithm_
gridOrResolution=Raster(enmapboxtestdata.enmap).grid())
File "C:\Users\geo_beja\Repositories\enmap-box\enmapboxtestdata\__init__.py", line 82, in createFraction
Fraction.fromClassification(filename=filename, classification=vectorClassification, grid=grid)
File "C:\Users\geo_beja\Repositories\enmap-box\hubflow\core.py", line 4520, in fromClassification
applier.apply(operatorType=_FractionFromClassification, classification=classification)
File "C:\Users\geo_beja\Repositories\enmap-box\hubflow\core.py", line 55, in apply
overwrite=self.kwargs.get('overwrite', True), *ufuncArgs, **ufuncKwargs)
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\applier.py", line 979, in apply
results = self._runProcessSubgrids()
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\applier.py", line 1043, in _runProcessSubgrids
blockResults.append(_Worker.processSubgrid(**kwargs))
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\applier.py", line 1126, in processSubgrid
nxblock=nx)
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\applier.py", line 1272, in _apply
blockResult = self.ufunc(*self._ufuncArgs, **self._ufuncKwargs)
File "C:\Users\geo_beja\Repositories\enmap-box\hubflow\core.py", line 4727, in ufunc
array = self.flowFractionArray('classification', fraction=classification)
File "C:\Users\geo_beja\Repositories\enmap-box\hubflow\core.py", line 351, in flowFractionArray
overlap=overlap)
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\applier.py", line 320, in fractionArray
array.append(oversampledRaster.array(overlap=overlap, resampleAlg=gdal.GRA_Average))
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\applier.py", line 138, in array
multithread=multithread,)
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\core.py", line 1693, in array
multithread=multithread, srcNodata=noDataValue)
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\core.py", line 1548, in warp
if not resampleAlg in ResampleAlgHandler.warpResampleAlgorithms():
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\core.py", line 3228, in warpResampleAlgorithms
return [name for name in cls.resampleAlgorithms() if not name in ['gauss']]
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\core.py", line 3222, in resampleAlgorithms
gdal.__dict__.items() if
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\core.py", line 3220, in <listcomp>
resampleAlgs = [cls.toString(resampleAlg=resampleAlg) for resampleAlg in
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\core.py", line 3214, in toString
raise TypeError('unexpected value: {}'.format(resampleAlg))
TypeError: unexpected value: 14

Traceback (most recent call last):
File "C:\Users\geo_beja\Repositories\enmap-box\enmapboxgeoalgorithms\provider.py", line 155, in processAlgorithm
result = self.processAlgorithm_()
File "C:\Users\geo_beja\Repositories\enmap-box\enmapboxgeoalgorithms\algorithms.py", line 591, in processAlgorithm_
gridOrResolution=Raster(enmapboxtestdata.enmap).grid())
File "C:\Users\geo_beja\Repositories\enmap-box\enmapboxtestdata\__init__.py", line 82, in createFraction
Fraction.fromClassification(filename=filename, classification=vectorClassification, grid=grid)
File "C:\Users\geo_beja\Repositories\enmap-box\hubflow\core.py", line 4520, in fromClassification
applier.apply(operatorType=_FractionFromClassification, classification=classification)
File "C:\Users\geo_beja\Repositories\enmap-box\hubflow\core.py", line 55, in apply
overwrite=self.kwargs.get('overwrite', True), *ufuncArgs, **ufuncKwargs)
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\applier.py", line 979, in apply
results = self._runProcessSubgrids()
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\applier.py", line 1043, in _runProcessSubgrids
blockResults.append(_Worker.processSubgrid(**kwargs))
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\applier.py", line 1126, in processSubgrid
nxblock=nx)
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\applier.py", line 1272, in _apply
blockResult = self.ufunc(*self._ufuncArgs, **self._ufuncKwargs)
File "C:\Users\geo_beja\Repositories\enmap-box\hubflow\core.py", line 4727, in ufunc
array = self.flowFractionArray('classification', fraction=classification)
File "C:\Users\geo_beja\Repositories\enmap-box\hubflow\core.py", line 351, in flowFractionArray
overlap=overlap)
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\applier.py", line 320, in fractionArray
array.append(oversampledRaster.array(overlap=overlap, resampleAlg=gdal.GRA_Average))
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\applier.py", line 138, in array
multithread=multithread,)
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\core.py", line 1693, in array
multithread=multithread, srcNodata=noDataValue)
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\core.py", line 1548, in warp
if not resampleAlg in ResampleAlgHandler.warpResampleAlgorithms():
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\core.py", line 3228, in warpResampleAlgorithms
return [name for name in cls.resampleAlgorithms() if not name in ['gauss']]
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\core.py", line 3222, in resampleAlgorithms
gdal.__dict__.items() if
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\core.py", line 3220, in <listcomp>
resampleAlgs = [cls.toString(resampleAlg=resampleAlg) for resampleAlg in
File "C:\Users\geo_beja\Repositories\enmap-box\hubdc\core.py", line 3214, in toString
raise TypeError('unexpected value: {}'.format(resampleAlg))
TypeError: unexpected value: 14

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\geo_beja\Repositories\enmap-box\enmapboxgeoalgorithms\provider.py", line 169, in processAlgorithm
raise Exception('unexpected error')
Exception: unexpected error

Execution failed after 0.29 seconds

Loading resulting layers
Algorithm 'Create Test Fraction Map' finished

Comments (2)

  1. Andreas Janz

    I removed all “Create Test * Map“ algos from the GUI.

    Additional testdata is now explicitely placed in the testdata repo under \enmap-box-testdata\enmapboxunittestdata.

  2. Log in to comment