I am trying to build a very simple model in QGIS.
Simple intersection process (Density Zone-as intersection layer; watershed-as the other layer) followed by adding an "Area(ha)" field and finally the calculation of the population by multiplication of "Density Zone" field with "Area(ha)" field.
However, I want to add a table field parameter "Density Field" for example (density zone) which can be selected by the user from the "intersection layer". I couldn't call the field parameter value into the field calculator algorithm.
I tried typing the functions:
Density Field * "Area(ha)"
"Density Field" * "Area(ha)"
'Density Field' * "Area(ha)"
I searched for "advanced python don't calculator". I don't know python code syntax so I couldn't manage to do so. I also tried following texts in the advanced Python field calculator:
value= getvalue(<Density Zone>) * "Area(ha)"
value= getvalue(<Density Zone>) * (Area(ha))
All I wanted to do is to link the table field parameter into the functions' formula.
The problem is that a table field parameter cannot be introduced into a formula in order to create a new field.
Let's say there is a vector layer as an input. And another vector layer which will be used as an intersection layer. The first method is to intersect these two layers. The output of this intersection process will be used as a result layer but with further modifications. Secondly, in this processed layer, an area field will be added by the field calculator operator. Up to here, there is no problem.
Next, a second field will be created which is the multiplication of the area field previously created with the field which will be selected from the intersection layer (this field should be introduced as a "table field parameter" and must be selected by the user-user must know which field that is for this particular problem it is "density" field). The resulting output vector layer will have two new fields created which are "area" and "population" which is the multiplication of "area" and "density" fields.
I am struggling is how to type the multiplication formula by introducing the "table field parameter" (density) into the formula.
Area(ha)
a valid field name? Does the model create this field?"Density Field" * $area/10000