uses expressions for parameter values and contains variables
generated by another step in the model
We were showing links for these in the model designer so it
appeared as though the dependencies were there, but at actual
execution time there was nothing forcing the child which generated
the variable to be run before the child using the variable.
This adds a new "Reorder Model Outputs" action to the model designer
menu (to accompany the existing "Reorder Model Inputs" action).
Selecting this option allows model creators to set a specific order
which the outputs from their model must use when loading the results
into a project. This gives the model creator a means of ensuring
that layers are logically ordered, eg placing a vector layer over
a raster layer and a point layer over a polygon layer.
Optionally, the model creator can also set a "Group name" for the
outputs. If this is specified then all outputs from the model will
be placed into a (newly created if necessary) layer tree group
with that name.
Sponsored by the QGIS Germany User Group
also update the internal name of that parameter and all child algorithms
in the model accordingly
Before we just "faked" this by changing the parameter's description
only, but that meant that the old name was permenantly stuck and
had to be used in qgis_process or when calling the model via
python.
helpful comments next to all static enum parameter values used
in child algorithms with the corresponding text.
I.e. instead of
alg_params = {
'END_CAP_STYLE': 2,
}
we now export
alg_params = {
'END_CAP_STYLE': 2, # Flat
}
Much more readable!
Instead of forcing a quasi-random ordering of inputs for models,
this commit exposes a new "Reorder Model Inputs" option in the model
designer which allows users control over the exact order of
inputs to show users for their model.
No more illogical ordering like showing a field choice before the
layer choice it's based on!
Sponsored by NaturalGIS
This allows a range of new possibilities, including:
- models with static outputs for child algorithms, e.g. always saving
a child algorithm's output to a geopackage or postgres layer
- models with expression based output values for child algorithms, e.g.
generating an automatic file name based on today's date and saving
outputs to that file
These are a visual guide, allowing designers to create logical groups
of algorithms relating to a single task ("eg 'Prepare data')
The title and color of the group boxes can be customized
When designing a model, users typically will need to run the model
many times as they tweak its structure.
This change causes the parameters used when running the model from
the designer to be remembered and saved into the model, so that
each time you run the model from the designer you don't have to
re-set all the input parameter values to the desired test ones.
Makes iterative model design SO much easier!
Sponsored by Alta Ehf
This allows users to create comments attached to model components (inputs,
algorithms or outputs). Comments are shown linked to the associated component,
and can be freely moved around the model.