- edited description
[Raster math] unsupported data type: int64
Issue #1245
resolved
code snippet:
mask = np.where(mask[2] == 0, 1, 0)
Algorithm 'Raster math' starting…
Input parameters:
{ 'R1' : None, 'R10' : None, 'R2' : None, 'R3' : None, 'R4' : None, 'R5' : None, 'R6' : None, 'R7' : None, 'R8' : None, 'R9' : None, 'RS' : None, 'V1' : None, 'V10' : None, 'V2' : None, 'V3' : None, 'V4' : None, 'V5' : None, 'V6' : None, 'V7' : None, 'V8' : None, 'V9' : None, 'code' : '# mask := QgsRasterLayer("/mnt/5410/Fernerkundung-GIS/Fabian/_temp/daten_spj/20200118_LEVEL2_LND08_QIM.tif")\nmask = np.where(mask[2] == 0, 1, 0)\n', 'floatInput' : True, 'grid' : None, 'monolithic' : False, 'outputRaster' : '/vsimem/mask.tif', 'overlap' : None }
Traceback (most recent call last):
File "/root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/site-packages/typeguard/__init__.py", line 903, in wrapper
retval = func(*args, **kwargs)
File "/root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapboxprocessing/algorithm/rastermathalgorithm/rastermathalgorithm.py", line 268, in processAlgorithm
writers = self.makeWriter(code, filename, grid, readers, readers2, floatInput, feedback)
File "/root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/site-packages/typeguard/__init__.py", line 903, in wrapper
retval = func(*args, **kwargs)
File "/root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapboxprocessing/algorithm/rastermathalgorithm/rastermathalgorithm.py", line 331, in makeWriter
dataType = Utils.numpyDataTypeToQgisDataType(result.dtype)
File "/root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/site-packages/typeguard/__init__.py", line 903, in wrapper
retval = func(*args, **kwargs)
File "/root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapboxprocessing/utils.py", line 135, in numpyDataTypeToQgisDataType
raise Exception(f'unsupported data type: {dataType}')
Exception: unsupported data type: int64
Execution failed after 0.44 seconds
#QGIS version
3.24.1-Tisler
#QGIS code revision
5709b82461
#Qt version
5.12.8
#Python version
3.8.10
#GDAL/OGR version
3.0.4
#PROJ version
6.3.1
#EPSG Registry database version
v9.8.6 (2020-01-22)
#Compiled against GEOS
3.8.0-CAPI-1.13.1
#Running against GEOS
3.8.0-CAPI-1.13.1
#OS version
Ubuntu 20.04.4 LTS
Comments (6)
-
reporter -
Hi Fabian, QGIS has no Int64 data type, I think I will silently cast to Float32, to avoid the problem.
-
Or not silently, but instead pushing a warning.
-
reporter Yes a good idea I suppose. I mean casting it to
np.short
in the code block works of course, but that's probably nothing the average user wants to deal with. -
- changed milestone to 3.10 (Hotfix)
-
- changed status to resolved
- Log in to comment