I'm looking to apply a mask to a number of rasters in PyQGIS. (updated but still not working)
import processing
rstr = "/Users/rasterfilepath/"
shp = "/Users/shapefile.shp"
outputDir = "/Users/output/"
for lyr in rstr:
processing.runandload("gdalogr:cliprasterbymasklayer", rstr, shp, "none", False, False, "", outputDir + lyr + ".tif")
What am I doing wrong?
lyr +=1
. lyr is a string and the plus sign with a string is concatenation. So, it's trying to concatenate the layer name and 1. take that line out.