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

処理プラグインを書く

開発しようとしているプラ​​グインの種類によっては、プロセッシングアルゴリズム(またはそれらのセット)として機能を追加する方が良い場合もあるでしょう。そうすれば、QGIS内でのより良い統合がなされ(これは、モデラーやバッチ処理インターフェイスといった、「プロセッシング」のコンポーネントの中で実行できますので)、追加の機能、そして迅速な開発時間です(「プロセッシング」は作業時間の大部分を占めるので)。

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:

  • [プラグインビルダー]プラグインをインストールします。

  • プラグインビルダーを使用して新しいプラグインを作成します。プラグインビルダーがテンプレートを使用するように求めてきたら、「処理プロバイダ」を選択します。

  • 作成したプラグインには、単一のアルゴリズムを持つプロバイダが含まれます。プロバイダファイルおよびアルゴリズムファイルの両方とも、十分にコメントがついていて、プロバイダを修正したりさらにアルゴリズムを追加する方法についての情報が含まれています。詳細については、それらを参照してください。

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.