Why working with Python Scripts in QGIS 2.8 Processing Toolbox

Although Processing Toolbox has graphical modeler to power the usability of already available documents but  it has some limitations:

  • There is no support for conditional statements and loops.
  • Only available models can be used, some algorithms that can be executed from the toolbox do not appear in the list of available algorithms when you are designing a model.
    • For including in a model, an algorithm must have a correct semantic, so as to be properly linked to others in the workflow. I
    • If an algorithm does not have such a well-defined semantic (for instance, if the number of output layers cannot be known in advance), then it is not possible to use it within a model, and thus, it does not appear in the list of algorithms that you can find in the modeler dialog.

But in addition, you will see some algorithms in the modeler that are not found in the toolbox.

  • These algorithms are meant to be used exclusively as part of a model, and they are of no interest in a different context.
  • The ‘Calculator’ algorithm is an example of that. It is just a simple arithmetic calculator that you can use to modify numerical values (entered by the user or generated by some other algorithm). This tool is really useful within a model, but outside of that context, it doesn’t make too much sense.

CheatSheet to Work with Processing Algorithms

  1. import processing –  Starting Point
  2. processing.alglist() – Getting Algorithm List
  3. processing.alglist(‘count’) – Easy Way to find an algorithm by matching string
  4. processing.alghelp(‘qgis:creategrid’) – For help about algorithm
  5. processing.algoptions(‘qgis:creategrid’) – For knowing TYPE and numbering about inputs of algorithm





Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s