<div dir="ltr"><div>Hello,<br><br></div>I would like use r.mapcalculator in a PyQGIS processing script to change values from one raster in another accordingly. I don't know how to call the variables row and col, which are now read as simple strings in the following code:<br><div><div><br>processing.runalg('grass:r.mapcalculator',{"amap": rlayer, "bmap": emptylayer, "formula": "amap[row,col]=bmap[(%i+row*%i),(%i+col*%i)]"% (offset,scale,offset,scale), "GRASS_REGION_PARAMETER": "%f,%f,%f,%f"% (xmin, xmax, ymin, ymax), "outfile": bdry_resamp})<br><br></div><div>Does anyone know the correct syntax to use this? It would be fine to do it manually calling the module from the processing toolbox in QGIS as well, but then I would have to specify the 'formula' as well.<br><br></div><div>Thanks,<br><br></div><div>Sophie<br></div></div></div>