Tute M01 Boundaries QGIS Archive

From Tuflow
Revision as of 13:25, 5 April 2024 by Emilie Nielsen (talk | contribs) (→‎Introduction)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction

This page details the method for using QGIS to create the GIS based boundary layer files. Once the GIS layers are setup (detailed in this page), these are linked to data using a boundary database, (the boundary database is described in Module 1). We will create three different boundaries:

  • Upstream flow boundary
  • Downstream water level - flow (stage-discharge) boundary
  • Internal flow boundary

The first two boundaries are input into a 2d_bc type layer. The third boundary (internal flow boundary) will be applied as a source-area boundary in a 2d_SA boundary type layer.

Method

2d_bc Type Boundaries

We will create the 2d_bc boundaries first. These boundaries are external and will "snap" to the edge of our active model area. Both of these boundaries have been aligned perpendicular to flow direction.
Note: This line orientation is recommended for 2d_bc QT, HQ and HT boundary inputs. Care should be taken to digitise these boundary types perpendicular to flow direction (i.e. across the waterway). If they are digitised oblique to the flow (i.e. not perpendicular) model instabilities can result in some cases.

  1. Load the DEM Module_Data\DEMs\QGIS\DEM_M01.img
  2. Load the code polygon TUFLOW\model\gis\2d_code_M01_002_R.shp (this was created in the previous step).
  3. Load the template 2d bc type layer (2d_bc_empty_L.shp) from TUFLOW\model\gis\empty\.
  4. Save a copy of the template under the TUFLOW\model\gis folder as 2d_bc_M01_002_L.shp. Note that we save the file into the \model\gis\ directory not the \model\gis\empty\ directory.
  5. Open the newly saved, 2d_bc_M01_002_L.shp add it to the map window and close the template.
  6. The QGIS window should now look something like this:
    Tute M01 QGIS 2d bc 01.png


  7. The first step is to change the style of the code region to make it a bit easier to work with. Right click on the 2d_code_M01_002_R in the layers section and select properties.
  8. In the Style tab, select the "Change" button, highlighted with a red oval in the image below.
  9. Tute M01 QGIS 2d bc2.png


  10. In the Symbol Layers section, select the Add Symbol Layer.
    This gives us to symbol layers for the same file. For the first layer set the following options (see the 1st image below):
    • Set the Symbol Layer Type to Outline: Marker Line
    • Set the Marker placement to On Every Vertex.

    For the second Symbol Layer set the following options (see the 2nd image below):
    • Set the Symbol Layer Type to Simple Fill
    • Set the Fill Style to No Brush.

    Tute M01 QGIS 2d bc3.png


    Tute M01 QGIS 2d bc4.png


    The first layer sets the vertices (nodes) along the polygon line as visible, the second makes the polygon display as an outline only. This is important as we need to snap the boundary lines to the vertices on the code polygon. After applying the style changes the QGIS window should look like the image below.

    Tute M01 QGIS 2d bc5.png


  11. Before we begin modifying the 2d_bc layer, we need to enable snapping to the 2d_code region. To enable snapping select the Settings >>> Snapping Options...
    Select the check-box next to the 2d_code_M01_002_R item. Set the tolerance to 5 map units (5 metres) and select apply.
  12. Tute M01 QGIS 2d bc6.png


  13. Zoom into the creek at the south-western edge of the code polygon. Toggle editing for the 2d_bc_M01_002_L layer and then select the Capture Line. Create a line joining the four vertices shown below, when selecting the final vertex, use the right mouse button to terminate the line. When drawing the line, the cursor should snap to the existing vertices on the 2d_code layer.
  14. Tute M01 QGIS 2d bc7.png
  15. When you terminate the line, an attributes dialog will be displayed. Enter the following data:
    • Type = QT
    • Flags = Blank (remove the null)
    • Name = FC01 (that is FC Zero One)
    This designates the boundary as a flow ("Q") versus Time ("T") boundary with the name FC01 (as per the image below). The name attribute will link the GIS boundary with an inflow hydrograph in the boundary data base (described later).
    NOTE In QGIS, at this stage it is necessary to enter 0 in the f, d, td, a and b attributes. Most GIS store null numeric field entries as zero, QGIS does not it stores a null entry, however TUFLOW requires these to be entered, for later releases of TUFLOW this will be changed to recognise the QGIS null entry.
    Tute M01 QGIS 2d bc8.png


  16. At the downstream boundary (north of the code polygon), add another shape connecting the four vertices shown below.
    Tute M01 QGIS 2d bc10.png


    In the attributes window set the following:

    • Type = HQ
    • b = 0.01

    NOTE In QGIS, at this stage it is necessary to enter 0 in the f, d, td and a attributes. Most GIS store null numeric field entries as zero, QGIS does not it stores a null entry, however TUFLOW requires these to be entered, for later releases of TUFLOW this will be changed to recognise the QGIS null entry.

    Tute M01 QGIS 2d bc9.png


    The remaining attributes are to be left blank or with the default value of 0 (including the name).

    The type "HQ" designates this as a Water Level ("H") versus Flow ("Q") boundary. This is a stage-discharge boundary condition. If a Name is specified, the user must define this stage-discharge relationship in the boundary database. In this case a water surface slope value is specified via the "b" attribute, this value of 0.01 is in metres per metre and corresponds to a 1% water surface slope. TUFLOW will automatically create a stage-discharge curve flow this location, based on the underlying topography, roughness and specified water surface slope.
  17. Toggle the editing off and when prompted save the 2d_bc_M01_002_L.

2d_sa Type Boundary

The next step is to create an internal inflow boundary using a source-area inflow this is done with a 2d_sa type layer.

  1. Load the 2d_sa_empty_R.shp template file from the TUFLOW\model\gis\empty\. Save a copy of the layer in the TUFLOW\model\gis\ directory as 2d_sa_M01_002_R.shp.
  2. Load the newly created 2d_sa_M01_002_R file and close the template file.
  3. Add the layer to a map window with the DEM.
  4. Add a new shape and digitise a polygon around the dam in the lower right (south-east) of the screen.
  5. Tute M01 QGIS 2d sa1.png


  6. When prompted enter "FC04" under the Name attribute (FC zero four, without the quotes).
  7. Tute M01 QGIS 2d sa2.png


  8. Finish the edit by toggle the editing and when prompted, save the file.

Conclusion

QGIS has been used to create the 2d_bc layer that contains an upstream "QT" type inflow boundary and a downstream "HQ" stage-discharge type boundary. A second QGIS layer (2d_sa) defines an internal source boundary. Our next step is to assign hydrographs to the boundary locations created in this page. Please return to the tutorial model page here.