2

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.

Input Data

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:

Setup in Model Designer

Algorithm in Model Designer

Instead of "test" I have also tried attribute("test") and attribute(test)

All versions result in the following error message:

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.

Other attempt

How can I pass an attribute from a vector layer to a processing algorithm in the Model Designer?

Taras
35.7k5 gold badges77 silver badges151 bronze badges
asked Jul 29, 2024 at 18:50
1
  • I can confirm this issue on my QGIS 3.34.8-Prizren Commented Jul 29, 2024 at 20:03

2 Answers 2

0

Try 'test' instead of "test".

answered Aug 13, 2024 at 7:47
0

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

enter image description here

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

answered May 28 at 21:32

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.