I am using QGIS 3.34.9 and I have point data with several properties in the attribute table of which one is called "test"
. I would like to use the "Rectangles, ovals, diamonds" - Tool to draw ovals around each point in the QGIS Model Designer. The width of the ovals should be the value in the attribute table.
It works great outside of the Model Designer, where I can simply call the tool from the processing toolbox and select the field it should read the width from.
Algorithm in processing toolbox
Once in Model Designer, the same tool does not find the attribute "test"
. Here is my setup:
Instead of "test"
I have also tried attribute("test")
and attribute(test)
All versions result in the following error message:
In addition, I also tried to add the width via a vector field input, however, the drop-down is empty and I cannot select the vector field input there.
How can I pass an attribute from a vector layer to a processing algorithm in the Model Designer?
-
I can confirm this issue on my QGIS 3.34.8-PrizrenTaras– Taras ♦2024年07月29日 20:03:13 +00:00Commented Jul 29, 2024 at 20:03
2 Answers 2
Try 'test' instead of "test".
It's just a little bit more tricky than what you did. Assuming you are not iterating over your input layer when running the model (green iterate button enter image description here), then you can use the attribute function
attribute(@input_layer, 'height_field' )
where @input_layer is the name of your yellow input box in the modeler (with @ added).
you can even multiply that directly in the formula:
attribute(@input_layer, 'height_field' ) *10
On the other hand, if you iterating over your input layer, then it's just a little bit more tricky, I answered here:
Accessing current feature attribute, when iterating over vector features input in QGIS Model Builder
Explore related questions
See similar questions with these tags.