Project: QGIS

Version: 3.30

Feature: Support data defined parameter values when using qgis_process tool

While many processing algorithms supported data-defined parameter values, these were not possible to specify when using the qgis_process tool (or when representing algorithm settings as JSON and qgis_process commands), introducing limitations for utilizing QGIS within command line processing operations.

A new syntax is now provided to allow the specification of data-defined parameter values when running qgis_process operations, and copying the algorithm settings from QGIS will now correctly handle data-defined values.

Command line arguments are specified with the expression: prefix within an encapsulated string, whilst the JSON definition is implemented using an expression object with a data_defined type definition. Note that special characters within the expression will need to use the appropriate escape characters relevant to the context in which they are used.

Considering the expression @variable*"field_name"*to_int('2')/100 for the following examples, the command-line syntax would be:

--PARAMETER='expression:@variable*"field_name"*to_int('\''2'\'')/100'

Whilst the JSON representation would be:

"inputs": { "PARAMETER": { "expression": "@variable*\"field_name\"*to_int('2')/100", "type": "data_defined" }, "OUTPUT": "TEMPORARY_OUTPUT" }

This feature was funded by the Research Institute for Nature and Forest, Flemish Govt

This feature was developed by Nyall Dawson