Extracting cell values to vector points will allow us to further manipulate them through the Field Calculator.
(1) Generate points (pixel centroids) inside polygons tool
(Processing Toolbox > Vector creation)
This tool takes a raster and a vector polygon layer, to generate a point (vector layer) at the center of each pixel. However, this tool does ...
I got it to work. I stripped the script down to just the basics and ran it in the QGIS Python Console and it ran through all the state Block Group shapefiles just as I'd expect. The Zonal Stats fields are now in the attribute tables.
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from qgis.core import *
from qgis.utils import iface
In your code you just create layer. To visualize it in qgis map, you have to add the layer to the map canvas.
I tried to follow the advice above, my model now looks like this :
The calculate value content: (thanks smiller)
The zonal statistics as table content:
I don't have errors anymore, my initial question has been then solved!
Your path contains a form feed escape sequence - \f.
You need to use a raw string as your input. Raw strings ignore escape sequences.
Note the r before the start of the string.
Based on both linked questions, I understand the issue to be
You want to perform Zonal Statistics as Table with multiple input rasters and multiple corresponding output tables.
Your current process overwrites the output table for each raster, so you'd like to get a unique name for each output table.
The previous question's comments led you to use the ...
As you have not posted your error messages nor your configuration of your Zonal Statistics as Table element in the model, I can only guess as to what is going on here based on your question title. My guess is that your model is trying to repeatedly overwrite the output table and failing, because the output exists already.
If this is the case, then you can ...