Thursday, 21 December 2017

QGIS Modeler algorithm does not accept input variable



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?



Answer



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!


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...