Outdated version of the documentation. Find the latest one here.

Escribir nuevos complementos de procesamiento

En función del tipo de complemento que vayas a desarrollar, puede ser más recomendable añadir la funcionalidad en cuestión como un algoritmo de Procesamiento (o un conjunto de algoritmos). Esta opción permite una mejor integración en QGIS, añadiendo la funcionalidad (ya que así podrá ser ejecutada dentro de cualquiera los componentes de menú Procesos, como el modelador gráfico o la interfaz de procesos por lotes), y optimizando el tiempo de desarrollo (ya que el complemento de Procesos hará gran parte del trabajo).

This document describes how to create a new plugin that adds its functionality as Processing algorithms.

There are two main mechanisms for doing that:

  • Creating a plugin that adds an algorithm provider: This options is more complex, but provides more flexibility
  • Creating a plugin that contains a set of processing scripts: The simplest solution, you just need a set of Processing script files.

Creating a plugin that adds an algorithm provider

To create an algorithm provider, follow these steps:

  • Instala el complemento Plugin Builder.

  • Crea un nuevo complemento, usando el Plugin Builder. En el cuadro de diálogo del Plugin Builder, selecciona “Processing provider”.

  • The created plugin contains a provider with a single algorithm. Both the provider file and the algorithm file are fully commented and contain information about how to modify the provider and add additional algorithms. Refer to them for more information.

Creating a plugin that contains a set of processing scripts

To create a set of processing scripts, follow these steps:

  • Create your scripts as described in the PyQGIS cookbook. All the scripts that you want to add, you should have them available in the Processing toolbox.
  • In the Scripts/Tools group in the Processing toolbox, double-click on the Create script collection plugin item. You will see a window where you should select the scripts to add to the plugin (from the set of available ones in the toolbox), and some additional information needed for the plugin metadata.
  • Click on OK and the plugin will be created.
  • You can add additional scripts to the plugin by adding scripts python files to the scripts folder in the resulting plugin folder.