Chapter 2: Adding Input Data to the Graphic Modeller
To start a model, you will need to define the input data. The graphical modeller supports the following input types:
• Raster layer
• Table field
• Vector layer
To add an entry, double-click the appropriate category from the Entries tab or drag the entry onto the Graphic Modeller window. The Parameter Definition dialog box opens.
Give a name to the parameter and specify any other detail, such as the type of geometry in our example. The settings in this window change depending on which entry is chosen.
When the input setting is defined and added to the model, it is essentially a conceptual parameter. It will not actually be connected to a data layer until you are ready to run the model.
For this example, we added a vector layer that we called “Installations”. We have determined the type of geometry of the data (points) and we have classified it as mandatory.
All the objects in the graphic Modeller window can be selected with a mouse click and moved to be re-positioned in the window. By clicking on the pencil icon you will open the Parameter Definition dialog box and you can make the desired changes. By clicking on the Delete symbol (X) you delete the input of the model. For our example, we will add a second polygon type vector layer including the oyster plots. Finally, we will add a number entry. This will allow us to set the buffer distance value as an input that can be modified when the model is executed.
It will be called Distance and we will set a default value of 500, since 500 meters is the distance we want to use initially.
In the graphical modeller, the distances are expressed in reference coordinate system units.
The following screenshot shows the model with the entries: two vector layers and one number input.
Before continuing in our example, let’s look at the other possible types of input in the graphical modeller: Boolean
The parameter can take only two values: true or false. You define the name to use in the model and whether the default value is true (checked).
Extended The adding an Extended type entry (Extent) has no parameters other than the desired name. This entry will be added to the model window by filling in the given name with “(xmin, xmax, ymin, ymax)”.
You can then define a frame for the desired extent of the model result, either by entering the four coordinates of the corners of the extended, or by choosing an option from the drop-down menu available by default. In the example we simply entered “Extended” as the name of the entry.
Example of How an Expanded Entry Appears When Running the Model
File You can define a file type entry by determining whether it is a file or a directory.
Raster layer You will be able to define if the raster layer is essential or optional for the execution of the model.
String of characters You can enter a default value for a variable of String type which will be used when running the model.
Table You can specify as input a non-spatial table, defining whether it is required for the model execution.
Table field To indicate as input a table field, spatial or not, we must first include a vector type input layer or non-spatial table. The window for defining the parameters of the table field will offer you a list of available tables in the model.
In this example, the first two tables are the vector layers tables already entered in the model and the third one is a non-spatial table, also entered in the model.