Create geoprocessing models in QGIS

We have shown in a previous post how to create models in ArcGIS Desktop. This post will demonstrate how to do the same thing in QGIS desktop. Well no need to ask me which is easier, let us start and you will be the judge.

We intend to create a model that will assist a district to delineate where public bus stops can be situated.

We will use two line feature data representing major and minor

roads respectively. To do this, we will create buffers og 0.001DD around the roads and then intersect the two buffers.

You can download the sample data set and practice along.

Download sample data by clicking the link here:https://www.dropbox.com/sh/l6cx8zwlkmcgt7u/AADOQkkB32WOgI18jY0GCVBja?dl=0

1. Launch QGIS Desktop and go and click Processing on the main menu. choose Graphical Modeler.

1

2. In the Graphical Modeler window, select Vector Layer. Double click on it.

2

3. A parameter definition window will open. We begin to fill in our parameter names. Parameters are equivalent

to your imput features. We will create two parameters- major and minor. Fill in the name. shape type and whether

its required or not. Click Ok to create.

3

4. A parameter appears in the right window as seen on the screenshot below. Repeat the above process in step 3

and name the parameter- minor.

4

5.  On the bottom left of the window, click on the ‘algorthm tab’ to load the processing tree. Select GDAL/OGR – [OGR] Geoprocessing

– Buffer vectors. Double click on the Buffer vectors.

6

6. A Buffer vectors dialog window opens. a) Select your input layer. b) Assign a buffer distance c) Select Yes from

the dropdown here d) Select No from the dropdown tab. e)Give the output file a name. That name will appear on the model.

Click Ok.

7

Repeat this process for the minor roads. A glance at the right window will show the additions.

7. Next we go to the QGIS geoalgorithms – Vector overlay tools – Intersection. Double Click on Intersection.

8

8. The Intersection dialog window opens. a) Input the parameters to intersect. b) Put the layer to intersect. For our demo,

we are intersecting two line features.c) Assign a parameter name for the output file. d) Click on the location button to select

parent algorthms. This is an important step to make the model run successfully.

9

9. Select the two Buffer vectors by checking the boxes. Click OK

10

Click OK to finalise the intersect geoprocessing tool in the model.

10. On the right side window you can examine the model parameters. Input a model name- road and a group

name- station.

11

11. Click Save to save the model.

12

Then click ‘Run model’ to run the model

13

12. The Model processing window will open.

a) Input the vector layer b) In our model, we have two input parameters, so input the second sample data there.

c) We gp straight to the intersect parameter and since it is an output file, we assign a location and name for it.

For this demonstration, we unchecked the buffer output parameters as we do have need of them as part of our final result.

14

13. Once the model runs successfully, the result is displayed as a vector layer on the map canvas.

15

Thank you for following the demonstration.

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s