I have a simple command using gdal_calc that only works directly in the mac terminal. But, when I run in PHP using exec or in python, nothing happened.
I have a simple code like this :
gdal_calc.py -A input1.tif -B input2.tif --outfile=result.tif --calc="A+B"
In PHP:
exec('gdal_calc.py -A input1.tif -B input2.tif --outfile=result.tif --calc="A+B"', $output, $response);
this doesn't do anything so i run it direclty using python script
#!/usr/bin/env python
import subprocess
subprocess.call('gdal_calc.py -A input1.tif -B input2.tif --outfile=result.tif --calc="A+B"', shell=True);
no error and no result. When i use gdal_grid
or gdalwarp
it works well in both languages