3

I'm writing a python plugin for QGIS and I'd like to know if it's possible to provide an interface to it from the processing toolbox.

I can see how the existing algorithms are loaded into processing via providers, but I don't see any obvious way of loading an algorithm without modifying the module. Perhaps it isn't possible and I need to submit a feature request, or attempt at coding it myself.

I was expecting something like:

import processing
from myplugin import mysweetalgorithm
processing.load_algorithm(mysweetalgorithm)
2

You can write a processing script which imports your mysweetalgorithm and uses it. It will appear in the scripts section of the Processing toolbox.

Processing is automatically available in scripts so you don't need to import processing manually.

Check the example scripts which are provided with the standard processing installation to learn how to specify outputs and inputs for the algorithm and user interface.

  • I hadn't thought of doing it like that, but it makes perfect sense. – Snorfalorpagus Jan 19 '14 at 11:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.