Difference between revisions of "Tutorial M01 Define Active Area QGIS"

From Tuflow
Jump to navigation Jump to search
(Created page with "= Introduction = QGIS is used to set an active model area.<br> <br> = Method = Use the TUFLOW plugin to create the code polygon layer: <ol> <li>Click on the ‘Import Empty Fi...")
 
 
(5 intermediate revisions by 2 users not shown)
Line 7: Line 7:
 
<li>Click on the ‘Import Empty File’ symbol from the TUFLOW Plugin toolbar. <br>
 
<li>Click on the ‘Import Empty File’ symbol from the TUFLOW Plugin toolbar. <br>
 
<br>
 
<br>
[[File:M01 ImportEmpty.png]]<br>
+
[[File:ImportEmpty_a.PNG]]<br>
 
<br>
 
<br>
 
<li>This opens the Dialog shown below. The TUFLOW plugin accesses the 'Empty Directory' created when the project was configured and provides a list of files to choose from. It appends the 'Empty Type' to the beginning of the 'RUN ID' and the 'Geometry Type' letter to the end. This becomes the name of the file. Make the following selections:
 
<li>This opens the Dialog shown below. The TUFLOW plugin accesses the 'Empty Directory' created when the project was configured and provides a list of files to choose from. It appends the 'Empty Type' to the beginning of the 'RUN ID' and the 'Geometry Type' letter to the end. This becomes the name of the file. Make the following selections:
Line 16: Line 16:
  
 
<br>
 
<br>
[[File:Animation M01 Code 01b.gif]]<br>
+
{{Video|name=Animation_M01_Code_01c.mp4|width=1274}}<br>
 
<br>
 
<br>
 
</ol>
 
</ol>
Line 22: Line 22:
 
<ol>
 
<ol>
 
<li>Load in the '''Model_Boundary.shp''' from the '''Module_01\Tutorial_Data''' folder. Either drag and drop the .shp into QGIS or navigate to the file through Layer > Add Layer > Add Vector Layer.
 
<li>Load in the '''Model_Boundary.shp''' from the '''Module_01\Tutorial_Data''' folder. Either drag and drop the .shp into QGIS or navigate to the file through Layer > Add Layer > Add Vector Layer.
<li>The region object in the '''Model_Boundary.shp''' is not in the TUFLOW file format and needs to be copied into the '''2d_code_M01_001_R.shp''' layer to have the correct attributes.
+
<li>The region object in the '''Model_Boundary''' is not in the TUFLOW file format and needs to be copied into the '''2d_code_M01_001_R''' layer to have the correct attributes.
<li>Make the '''2d_code_M01_001_R.shp''' layer editable by right clicking the layer and selecting 'Toggle Editing'.
+
<li>Make the '''2d_code_M01_001_R''' layer editable by right clicking the layer and selecting 'Toggle Editing'.
<li>Select the '''Model_Boundary.shp''' file by left clicking on it once in the Layers panel and use the 'Select Features' tool to highlight it. <br>
+
<li>Select the '''Model_Boundary''' file by left clicking on it once in the Layers panel and use the 'Select Features' tool to highlight it. <br>
 
<li>Select 'Edit' from the top QGIS tab and 'Copy Features' from the drop down menu.   
 
<li>Select 'Edit' from the top QGIS tab and 'Copy Features' from the drop down menu.   
<li>Select the '''2d_code_M01_001_R.shp''' layer in the Layers panel by left clicking on it once. Select 'Edit' from the top QGIS tab and click 'Paste Features' from the drop down menu.<br>
+
<li>Select the '''2d_code_M01_001_R''' layer in the Layers panel by left clicking on it once. Select 'Edit' from the top QGIS tab and click 'Paste Features' from the drop down menu.<br>
 
<br>
 
<br>
[[File:Animation M01 Code 02b.gif]]<br>
+
{{Video|name=Animation_M01_Code_02c.mp4|width=1274}}<br>
 
<br>
 
<br>
 
</ol>
 
</ol>
 
Define the area as active:
 
Define the area as active:
 
<ol>
 
<ol>
<li>At present the '''2d_code_M01_001_R.shp''' is not active. Using the 'Identify Features' tool click on the '''2d_code_M01_001_R.shp''' region in QGIS. The attribute 'Code' has a value of 'NULL'.
+
<li>At present the '''2d_code_M01_001_R''' is not active. Using the 'Identify Features' tool click on the '''2d_code_M01_001_R''' region in QGIS. The attribute 'Code' has a value of 'NULL'.
<li>Right click on the 'NULL' value and select 'Edit Feature From', change the value to '1' and click 'OK'. <br>
+
<li>Click on the 'NULL' value and change the value to '1'. Click 'OK'. <br>
 
<li>Toggle the editing off to save the edits.<br>
 
<li>Toggle the editing off to save the edits.<br>
 
<br>
 
<br>
[[File:Animation M01 Code 03b.gif]]<br>
+
{{Video|name=Animation_M01_Code_03c.mp4|width=1274}}<br>
 
<br>
 
<br>
 
</ol>
 
</ol>
 
Use the TUFLOW plugin for styling the code polygon layer to make it easier to work with:
 
Use the TUFLOW plugin for styling the code polygon layer to make it easier to work with:
 
<ol>
 
<ol>
<li>Change the symbology of the '''2d_code_M01_001_R.shp''' layer to make it easier to work with.  
+
<li>Change the symbology of the '''2d_code_M01_001_R''' layer to make it easier to work with.  
<li>Left click the '''2d_code_M01_001_R.shp''' in the Layers panel to select it.
+
<li>Left click the '''2d_code_M01_001_R''' in the Layers panel to select it.
 
<li>Select ‘Apply TUFLOW Styles to Current Layer’.
 
<li>Select ‘Apply TUFLOW Styles to Current Layer’.
 
<li>This updates the styling of the layer to display points on the region vertices and set the opacity to 25%.<br>
 
<li>This updates the styling of the layer to display points on the region vertices and set the opacity to 25%.<br>
  
 
<br>
 
<br>
[[File:Animation M01 Code 04b.gif]]<br>
+
{{Video|name=Animation_M01_Code_04c.mp4|width=1274}}<br>
 
<br>
 
<br>
 
</ol>
 
</ol>

Latest revision as of 16:25, 14 August 2023

Introduction

QGIS is used to set an active model area.

Method

Use the TUFLOW plugin to create the code polygon layer:

  1. Click on the ‘Import Empty File’ symbol from the TUFLOW Plugin toolbar.

    ImportEmpty a.PNG

  2. This opens the Dialog shown below. The TUFLOW plugin accesses the 'Empty Directory' created when the project was configured and provides a list of files to choose from. It appends the 'Empty Type' to the beginning of the 'RUN ID' and the 'Geometry Type' letter to the end. This becomes the name of the file. Make the following selections:
    • Select '2d_code' from the Empty Type list.
    • In the Run ID box write: 'M01_001'.
    • Tick the 'Regions' Geometry Type and hit 'OK'.
  3. A file called 2d_code_M01_001_R.shp in a region format with the relevant TUFLOW attributes is created. The TUFLOW plugin automatically saves the file in the Module_01\TUFLOW\model\gis folder and opens it in the QGIS Layers panel.



The model extent is provided in a common shapefile:

  1. Load in the Model_Boundary.shp from the Module_01\Tutorial_Data folder. Either drag and drop the .shp into QGIS or navigate to the file through Layer > Add Layer > Add Vector Layer.
  2. The region object in the Model_Boundary is not in the TUFLOW file format and needs to be copied into the 2d_code_M01_001_R layer to have the correct attributes.
  3. Make the 2d_code_M01_001_R layer editable by right clicking the layer and selecting 'Toggle Editing'.
  4. Select the Model_Boundary file by left clicking on it once in the Layers panel and use the 'Select Features' tool to highlight it.
  5. Select 'Edit' from the top QGIS tab and 'Copy Features' from the drop down menu.
  6. Select the 2d_code_M01_001_R layer in the Layers panel by left clicking on it once. Select 'Edit' from the top QGIS tab and click 'Paste Features' from the drop down menu.



Define the area as active:

  1. At present the 2d_code_M01_001_R is not active. Using the 'Identify Features' tool click on the 2d_code_M01_001_R region in QGIS. The attribute 'Code' has a value of 'NULL'.
  2. Click on the 'NULL' value and change the value to '1'. Click 'OK'.
  3. Toggle the editing off to save the edits.



Use the TUFLOW plugin for styling the code polygon layer to make it easier to work with:

  1. Change the symbology of the 2d_code_M01_001_R layer to make it easier to work with.
  2. Left click the 2d_code_M01_001_R in the Layers panel to select it.
  3. Select ‘Apply TUFLOW Styles to Current Layer’.
  4. This updates the styling of the layer to display points on the region vertices and set the opacity to 25%.



Conclusion

  • The 2d_code layer was created setting the code value for cells inside the polygon to active (code = 1).


Up
Go-up.png Back to Module 1 Main Page