3


I am trying to make a QGIS model which includes an "Extract by Attribute" algorithm. One of the inputs for this function is the liminar value, simply called "Value". For some reason though, it is only possible to explicitly state that value, and not use a number variable that was inserted into the model.

Is this behaviour as expected or a bug? Is there a work around?

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Nov 17, 2015 at 21:30

1 Answer 1

5

The Extract by attribute tool from the modeler accepts String inputs, not Number inputs. Here's a simple test which uses the following input parameters:

  • Input - Table Field
  • Layer - Vector layer
  • Value - String (with default value of 80)

Modeler

Now when I run this, the default value will show up automatically:

Running the modeler

I have tested this on various field attributes (integer, real etc.) and it works great! Hope this helps!

answered Nov 18, 2015 at 11:17
2
  • 1
    Perfect! Although I still disagree with QGIS developers! Doesn't make too much sense. Commented Nov 18, 2015 at 12:22
  • @jhc - Awesome, glad it works buddy! Haha, well the String parameter does allow for text aswell as numbers in attributes so it makes sense to me but it's personal opinion :) Commented Nov 19, 2015 at 10:02

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.