23.8. Usar procesamiento desde la línea de comando

QGIS comes with a tool called QGIS Processing Executor which allows you to run Processing algorithms and models (built-in or provided by plugins) directly from the command line without starting QGIS Desktop itself.

From a command line tool, run qgis_process and you should get:

QGIS Processing Executor - 3.16.8-Hannover 'Hannover' (3.16.8-Hannover)
Usage: C:\OSGeo4W\apps\qgis-ltr\bin\qgis_process.exe [--json] [command] [algorithm id or path to model file] [parameters]


  --json          Output results as JSON objects

Available commands:

  plugins          list available and active plugins
  plugins enable   enables an installed plugin. The plugin name must be specified, e.g. "plugins enable cartography_tools"
  plugins disable  disables an installed plugin. The plugin name must be specified, e.g. "plugins disable cartography_tools"
  list             list all available processing algorithms
  help             show help for an algorithm. The algorithm id or a path to a model file must be specified.
  run              runs an algorithm. The algorithm id or a path to a model file and parameter values must be specified.
                   Parameter values are specified after -- with PARAMETER=VALUE syntax.
                   Ordered list values for a parameter can be created by specifying the parameter multiple times,
                   e.g. --LAYERS=layer1.shp --LAYERS=layer2.shp
                   If required, the ellipsoid to use for distance and area calculations can be specified via the "--ELLIPSOID=name" argument.
                   If required, an existing QGIS project to use during the algorithm execution can be specified via the "--PROJECT_PATH=path" argument.


Only installed plugins that advertize hasProcessingProvider=yes in their metadata.txt file are recognized and can be activated or loaded by qgis_process tool.

El comando list puede ser usado para obtener una lista de proveedores y algoritmos disponibles.

qgis_process list

El comando help puede ser usado para obtener mas información sobre comandos o algoritmos.

qgis_process help qgis:regularpoints

El comando run puede ser usado para ejecutar un algoritmo o modelo. Especificar el nombre del algoritmo o una ruta a un modelo como primer parámetro.

qgis_process run qgis:buffer -- INPUT=source.shp DISTANCE=2 OUTPUT=buffered.shp

Where a parameter accepts a list of values, set the same variable multiple times.

qgis_process run native:mergevectorlayers -- LAYERS=input1.shp LAYERS=input2.shp OUTPUT=merged.shp

While running an algorithm a text-based feedback bar is shown, and the operation can be cancelled via CTRL+C. The run command also supports further parameters.

  • --json formateará la salida estándar de una manera estructurada JSON.

  • --ellipsoid establecerá el elipsoide en el especificado.

  • --distance_units usará las unidades especificadas de distancia..

  • --area_units usará las unidades de área especificadas.

  • --project_path cargará el proeycto especificado para ejecutar el algoritmo.