This was a missing capability in the processing API - while algorithms
could declare multiple layer input parameters, there was no corresponding
multi-layer output. This meant that algorithms (such as Package Layers,
Vector Split) which create a set of layers which cannot be determined
in advance had no way to pass these generated layers on for further model
processing steps.
It's also useful for algorithms which operate on a specified folder,
processing all layers found there, and allowing these generated
outputs to be utilised in other model steps (e.g. packaging
all of them, merging them, etc)
When running algorithms through the toolbox, which have dynamic
numeric parameters, add a data defined property override button
next to the widget so that users can set the overrides for these
parameters.
Previously this was available only in the backend, but not
exposed anywhere in the GUI.
Note that currently no algorithms support dynamic parameters,
so don't expect to see this everywhere. It's also only available
in toolbox/batch processing modes, not in models.
Since these expressions were only evaluated immediately, it led to
confusing behavior for users who were expecting that the expression
would be applied per-feature.
Given that expressions can be directly entered into spin boxes, we already
have a way of users evaluating simple calculations for numeric
parameters at least.
I don't think there's a strong enough use case for needing to
calculate string results to leave the confusing expression builder
option in place.
This should be re-evaluated when we add UI support for dynamic
parameters (which are already supported in the backend), where
expressions are evaluated per-feature.
Fixes#17267
* A new createopt textbox has been added to the parameters dialog for algorithms which exports to raster files.
* A new metaopt textbox has also been added to the Algorithm parameters dialog.
* Raster file format is detected from output filename extension.
* GdalUtils has been improved to correctly detect raster formats supported for creation.
* QFileDialog for output rasters now display only file filters for supported output raster file formats.
Previously we took a harsher approach to filtering which inputs
were acceptable for child algorithm parameters. E.g. a child algorithm
with a vector layer input would only show outputs from other algorithms
which generated a vector layer output.
But this can needlessly restrict what's possible in models. E.g.
an algorithm which outputs a QgsProcessingOutputFile or
QgsProcessingOutputString could potentially be a valid source
to a vector layer. So we should allow these as possible
inputs for vector layer parameters too.
This commit adds many extra acceptable input types for
child parameters. It will probably expose "corner cases" where
algorithms may get unexpected input types, but these will
not affect existing model stability and can be fixed when
identified.
The payoff is a much more flexible modeler.
This allow to show checkboxes or radioboxes intead of line edit with button.
This is configurable for each algorithm thought ParameterSelection metadata parameter.
It is also possible to choose the number of columns.
This is not applied in case of the BatchDialog.
This allows creation of models with child algorithms which do
things like merge a selected layer with a predefined static
layer, or create a vrt with a mix of static and user selected
layers.
parameters which accept lists of multiple layers
E.g. build vrt alg, merge vector layers alg
Otherwise you may need to load 100's of layers temporarily into
a project to perform algs on them