Tute M01 Active Areas QGIS

From Tuflow
Jump to: navigation, search


This page details the method for using QGIS to set an active model area. A preliminary model extent is provided for the tutorial model, this will be copied into a TUFLOW format file.


  1. Load the 2d_code_empty_R.shp template file from the TUFLOW\model\gis\empty folder.
  2. Right click on the empty (template) layer 2d_code_empty_R in the layer control and select Save As...
    Tute M01 QGIS 2d code1.png

  3. In the Save As section, hit the Browse button and save the file in the TUFLOW\model\gis\ directory as 2d_code_M01_002_R.shp
    Tute M01 QGIS 2d code2.png
  4. Open the newly saved 2d_code_M01_002_R.shp file.
  5. The empty file can now be closed, to do this right click on the layer in the Layers section and select remove.
    Tute M01 QGIS 2d code3.png
  6. Load the Boundary_region.shp file from the Module_Data\Module_01\QGIS\ folder.
  7. Set the 2d_code_M01_002_R layer as editable, by right-clicking on the layer and selecting Toggle Editing.
    Tute M01 QGIS 2d code4.png
  8. Select the polygon provided from the Boundary_region layer. To do this, select the layer in the Layer control section, and hit the Select Single Feature from the menu as shown in the image below. Once this is selected, highlight the polygon (it should change colour when selected).
    Tute M01 QGIS 2d code5.png
  9. Select Edit >> Copy Feature (Control + C).
  10. Select the 2d_code_M01_002_R layer in the layer control and select Edit >> Paste Feature (Control + V).
  11. Select the Identify Feature button (arrow beside blue i icon), and click on the polygon in the Map Window. The information window should show that the Code Feature is set to 1. This is shown in the image below.
    Note: If this is not the case, expand the Actions item and select Edit Feature Form.
    Tute M01 QGIS 2d code6.png
  12. To finish the edit, select the toggle editing and when prompted, save the file.
  13. Enter the following line of text into the TGC file after the Set Code == 0 command and save the TGC file.
    Read GIS Code == ..\model\gis\2d_code_M01_002_R.SHP


QGIS has been used to create a 2d_code layer which sets the code value for cells inside the boundary polygon to active (code = 1). Please return to the tutorial model module 1 page here.