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

Een plug-in voor Processing schrijven

Afhankelijk van het soort plug-in dat u gaat ontwikkelen, zou het misschien een betere optie zijn om de functionaliteit ervan toe te voegen als een algortime voor Processing (of een set daarvan). Dat zou tot een betere integratie in QGIS leiden, aanvullende functionaliteit (omdat het kan worden uitgevoerd in de componenten van Processing, zoals Grafische modellen bouwen of de Processing interface voor batchverwerking), en een snellere ontwikkelingstijd (omdat Processing een groot deel van het werk zal overnemen).

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:

  • Installeer de plug-in Plugin Builder

  • Maak een nieuwe plug-in met de Plugin Builder. Wanneer de Plugin Builder u vraagt naar het te gebruiken sjabloon, selecteer dan “Processing provider”.

  • De gemaakte plug-in bevat een provider met één enkel algoritme. Zowel het bestand voor de provider als het bestand voor het algoritme zijn volledig voorzien van commentaar en bevatten informatie over hoe de provider aan te passen en aanvullende algoritmen toe te voegen. Verwijs daarnaar voor meer meer informatie.

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.