This question is a follow up from a suggestion from this thread:
How to export a single feature (line) from multiple layers and export to individual layers?
I'm creating a batch process that selects a line (feature) from a vector layer and saves the selected feature to a child layer containing the name of the parent.
I'm using $length = maximum($length, group_by:= "id")
as the expression because I want to select the longest line in each layer.
The question is how do I export only selected features in the Processing Modeler? I can't find a "Export – Save Selected Features As…" option.
Best Answer
To export features from expression in the modeler, first you need to Extract features by expression instead of select them.
In the modeler algorithm, you can define a named output.
Source: https://docs.qgis.org/testing/en/docs/training_manual/processing/modeler_twi.html#starting-with-the-graphical-modeler
When you run the model, you can define to write the named output to a file (instead a temporary file) and load it to the canvas or not.