I want to calculate a new raster starting from my own raster. I use QGIS Raster Calculator and it works. Then I want to include it in a python script to create it manually. My new raster is created but empty. I am searching where the problem comes from. My formula is correct (when I copy paste it in QGIS Raster Calculator it works fine). So I tried to execute it directly from the console, I got this error and qgis closed :
My code is the following :
l=iface.activeLayer() a=l.extent() b=l.width() c=l.height() from qgis.analysis import QgsRasterCalculator, QgsRasterCalculatorEntry rast = QgsRasterCalculatorEntry() entries=[rast] calc = QgsRasterCalculator( '("lu_6@1"=210)*200',"D:/ju/Histo_Europe_folder_test/test_map.tif",'GTiff',a,b,c,entries )
My raster layer is called lu_6 and I am using QGIS 2.18.9.
Any idea why I get this error ?