We now provide a mechanism to support complex input parameters for algorithms when running the qgis_process command line tool.
To indicate that parameters will be specified via stdin then the qgis_process command must follow the format
qgis_process run algid -
(with a trailing - in place of the usual arguments list).
The JSON object must contain an "inputs" key, which is a map of the input parameter values.
e.g.
echo "{"inputs": {\"INPUT\": \"my_shape.shp\", DISTANCE: 5}}" | qgis_process run native:buffer -
Additionally, extra settings like the distance units, area units, ellipsoid and project path can be included in this JSON object:
{
'ellipsoid': 'EPSG:7019',
'distance_units': 'feet',
'area_units': 'ha',
'project_path': 'c:/temp/my_project.qgs'
'inputs': {'DISTANCE': 5, ..... }
}
(Specifying input parameters via stdin implies automatically the --json output format for results.)
One big motivation behind this enhancement is to provide a way for the qgisprocess R libraries to support parameter types such as aggregates!
This feature was funded by the Research Institute for Nature and Forest, Flemish Govt
This feature was developed by Nyall Dawson