I'm trying to perform some raster calculations (ex:
gdal_calc.py, but I'm stuck with an error when I try to make this simple test command:
import subprocess import sys subprocess.call([sys.executable, 'C:\\PROGRA~2\\GDAL\\gdal_calc.py', '-A', 'd:\\mnt_5x5.tif', '--outfile=d:\\test.tif', '--calc="A+1" '])
When I run it in CMD, it gives the following error:
0 .. Traceback (most recent call last): File "C:\PROGRA~2\GDAL\gdal_calc.py", line 329, in <module> main() File "C:\PROGRA~2\GDAL\gdal_calc.py", line 326, in main doit(opts, args) File "C:\PROGRA~2\GDAL\gdal_calc.py", line 282, in doit myResult = ((1*(myNDVs==0))*myResult) + (myOutNDV*myNDVs) TypeError: ufunc 'multiply' did not contain a loop with signature matching types dtype('S11') dtype('S11') dtype('S11')
GDAL is installed properly, since I had no problems running similar scripts with
The error mentions something about the
numpy class dtype, but I'm not very familiar with numpy syntax.
As seen here it's an easy task, I don't know what I'm missing.