The processing algorithms with the QGis 2.8 Graphic Modeller-Adding algorithms in the graphic modeller

The
algorithms are added in   the graphic modeller as if they were data input.
Simply select algorithms tab instead of Inputs data,
to observe the corresponding display in the  Boxprocessingtool
display.

Once the algorithm to be added is found, double- click, or glide toward the graphic window of the Modeller. To search the algorithm you can do it   as you would in the processing toolbox, typing the name in the search box at the top of the algorithm tab.

In fact , the algorithms tab is the window processing toolbox
opened in the modeller . This box display has two settings : Advanced and
Simplified.

[ caption id = “attachment_1691” align
= ” aligncenter ” width = “264”]  

Display
with advanced interface [ / caption]

settings display
with simplified interface [/ caption]

The interface parameter that is currently in use in the processing
toolbox determines how will be organized   the algorithms in the graphic modeller
. This parameter cannot be exchanged in the graphic modeller. To change the
setting , the graphic modeller has to be stopped, the interface parameter
exchanged in the processing toolbox and the graphic modeller relaunched. Besides
this, the algorithms search follows the same approach in the processing toolbox:
type the name or a part of the name of the processing being searched and you
will have the list of available processings.

In the algorithms tab, there is a special category called Specific
tools
 to the modeller
. The three tools – calculator , Raster layer boundaries and Vector layer
boundaries – do not appear in the processing toolbox. These are tools that only
make sense when are used under the graphic modeller.

The calculator tool is the most commonly used of the three tools . It
allows performing arithmetic calculations in the digital outputs of others
algorithms , and insert them as an entry in other processings of the same model
.

When you add the calculator to the graphic window,
the info window lists the available digital values within the model . The
window below allows entering a formula by using the letters assigned to each
digital value as variables. For example , the entered formula in the following
figure   displays the only numeric variable of our current model (the
buffer distance) and calculates twice this distance (a * 2).  

This output of the calculator algorithm can be used as input of another
algorithm of this model .

When you add an algorithm to the graphical modeller
window, the algorithm settings window opens . The dialog box will be very
similar to the one you would obtain if you were to launch, directly, the tool
from the processing box: you will get the input data, the output data and the tool
parameters.

However, there are some important differences because the graphic modeller
is an autonomous universe of data entries . The differences are the following:

• In the inputlayers
list you will be limited to those which have been added to the model .

• The Output field can be left empty if it is an
intermediate result that will be used as an entry for another algorithm . If
the exit is a layer that needs to be saved , enter the name of this layer in
the text box . When you name an exit layer , you do not need to provide an
output file name . This will be done when the tool is executed . Instead, it is
enough to enter the layer name (for example , buffer installations ).
It has to be correctly understood how do the output algorithm data works:

  • Since
    they, only, serve as data intermediaries for the following algorithms : you leave the name empty
  • Even if they are used by the following algorithms , you will want to keep the layer produced : you assign an output name.

This name is not the name of the output file but
the label that will be displayed in the execution window of the model when you execute
it . Remember that in the modeller, while creating the model, the data is not
used. You use labels that will be replaced by the real data only when the model
is executed.


Digital values or string of characters parameters can be entered directly as
numbers or chains, but they can also be choose among the entries of number or
chain type.  

• The fields of an attribute table ( or another autonomous table) can be
specified by typing the field name or by using the table field entry . These
fields will be choose when the model will be run .

• Parent algorithms is an additional parameter available
only with the tools run from the graphic modeller . It allows you to define the
execution order of the algorithms . The definition of a parent algorithm forces
the modeller chart to be run before running the algorithm that owns this
parent. Depending on the complexity of the model , you can have several
branches that come together or separate. The algorithms execution order will be
defined by QGis when running, but there is no guarantee that one algorithm be
executed before another , EXCEPT if you use the option ParentAlgorithm
.

On the other side, if you have a linear model, without branches , when
you define an algorithm output of as an entry for the next you, automatically,
set the first algorithm as a parent of the second .

In our example , we are going to execute as first
algorithm the calculation of a buffer zone around the oyster facilities.

It should be noted that instead of defining an explicit buffer distance,
the input buffer distance is used . Also, note that no output is named since
this output will be considered as an intermediate data set.

To complete our model , we will add the Clip tool
(cutting) in the model

We
will use the following settings:
• Input layer: Plots
• Cutting layer : “Buffer” of the “fixed distance buffer”
algorithm
• Output Layer (OutputVector): Riparian plots

The
final model looks like the following screenshot.   

The connecting lines show how the elements are linked to each other in
the workflow. The inputs, outputs and algorithms are represented by different color
boxes to distinguish them. The algorithms boxes contain also , on the left, an
icon representing the source library . In our example , both algorithms are
QGIS algorithms and have a Q icon in
the element box.

The model is now ready to be executed .

Si cet article vous a intéressé et que vous pensez qu'il pourrait bénéficier à d'autres personnes, n'hésitez pas à le partager sur vos réseaux sociaux en utilisant les boutons ci-dessous. Votre partage est apprécié !

Leave a Reply

Your email address will not be published. Required fields are marked *