I want to create a simple raster calculation using python and GDAL and specific gdal_calc.py
in osgeo4w shell.
BUT any time that before finish my script python stopping I take error : python.exe stop working
.
I have read to many post from users with this problem but without specific solution.
in my PATHEXT
I missed '.PY'
I try to add but without success.
here the first code :
gdal_calc = 'python C:/OSGeo4W64/bin/gdal_calc.py -A path/to/a.tif -B path/to/b.tif --outfile=path/to/out.tif --calc="((4*A)+(10*B))+4.8"'
try to add pathext :
call("set PATHEXT = % PATHEXT %;.PY;.PYW")
gdal_calc = 'python C:/OSGeo4W64/bin/gdal_calc.py -A path/to/a.tif -B path/to/b.tif --outfile=path/to/out.tif --calc="((4*A)+(10*B))+4.8"'
in this case I get windows error 2
after I try this :
os.environ['PATHEXT'] = '.PY'
gdal_calc = 'python C:/OSGeo4W64/bin/gdal_calc.py -A path/to/a.tif -B path/to/b.tif --outfile=path/to/out.tif --calc="((4*A)+(10*B))+4.8"'
but in this case gdal_calc.py don't execute .
Any idea how to can work this script without error ?