4

If I define a Vector Layer as an input parameter to a QGIS model, then the parameter name is exposed as a variable in a Field Calculator within the model, however I am unable to use this variable as I am not sure what data type it is. For example with a Vector Layer parameter of InData, I have tried evaluating the following expressions into a text field in a temporary layer:

@InData => ''

layer_properties(@InData, 'name') => NULL

layer_properties(@InData, 'id') => NULL

parameter( 'InData') => NULL

This is the model:

model

Variables exposed in Field Calculator (the expression doesn't seem to be case sensitive):

variables

My question is - how do you use the @indata variable? For example, can I use it to extract the CRS of the input layer?

A workaround is to use one of the @layer / @layer_id variables in a field calculator as the first tool connected to the input in the model, but then the result will need to be stored as an attribute if it is needed later in the model (see How to access input layer properties from QGIS' Modeler?).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.