Difference between revisions of "Tutorial M01 Define Active Area QGIS GPKG"
Jump to navigation
Jump to search
(→Method) |
(→Method) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
= Introduction = | = Introduction = | ||
QGIS is used to set an active model area.<br> | QGIS is used to set an active model area.<br> | ||
Line 20: | Line 17: | ||
<li>A layer called '''2d_code_M01_001_R''' in a region format with the relevant TUFLOW attributes is created. The TUFLOW plugin automatically creates a GeoPackage database called '''M01_001.gpkg''' in the '''Module_01\TUFLOW\model\gis''' folder, saves the '''2d_code_M01_001_R''' layer within it and opens it in the QGIS Layers panel.<br> | <li>A layer called '''2d_code_M01_001_R''' in a region format with the relevant TUFLOW attributes is created. The TUFLOW plugin automatically creates a GeoPackage database called '''M01_001.gpkg''' in the '''Module_01\TUFLOW\model\gis''' folder, saves the '''2d_code_M01_001_R''' layer within it and opens it in the QGIS Layers panel.<br> | ||
<br> | <br> | ||
− | + | {{Video|name=Animation_M01_GPKG_Code_01a_.mp4|width=1274}} | |
<br> | <br> | ||
+ | </ol> | ||
+ | |||
+ | The model extent is provided in a common GPKG layer: | ||
<ol> | <ol> | ||
<li>Load in the '''Model_Boundary''' from the '''Module_01\Tutorial_Data''' folder. Drag and drop the '''Model_Boundary.gpkg''' into QGIS. | <li>Load in the '''Model_Boundary''' from the '''Module_01\Tutorial_Data''' folder. Drag and drop the '''Model_Boundary.gpkg''' into QGIS. | ||
Line 30: | Line 30: | ||
<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> | <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> | ||
− | + | {{Video|name=Animation_M01_GPKG_Code_02_.mp4|width=1274}}<br> | |
<br> | <br> | ||
Line 41: | Line 41: | ||
<li>Toggle the editing off to save the edits.<br> | <li>Toggle the editing off to save the edits.<br> | ||
<br> | <br> | ||
− | + | {{Video|name=Animation_M01_GPKG_Code_03a.mp4|width=1274}} | |
+ | <br> | ||
<br> | <br> | ||
</ol> | </ol> | ||
Line 51: | Line 52: | ||
<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> | ||
− | + | {{Video|name=Animation_M01_Code_04c_.mp4|width=1274}} | |
+ | <br> | ||
<br> | <br> | ||
</ol> | </ol> |
Latest revision as of 11:19, 2 October 2023
Introduction
QGIS is used to set an active model area.
Method
Use the TUFLOW plugin to create the code polygon layer:
- Click on the ‘Import Empty File’ symbol from the TUFLOW Plugin toolbar.
- 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.
- In the Spatial Database Options, select 'All to one'. Navigate to the Module_01/TUFLOW/model/gis folder and save the GeoPackage database as M01_001.gpkg.
- Click 'OK'.
- A layer called 2d_code_M01_001_R in a region format with the relevant TUFLOW attributes is created. The TUFLOW plugin automatically creates a GeoPackage database called M01_001.gpkg in the Module_01\TUFLOW\model\gis folder, saves the 2d_code_M01_001_R layer within it and opens it in the QGIS Layers panel.
The model extent is provided in a common GPKG layer:
- Load in the Model_Boundary from the Module_01\Tutorial_Data folder. Drag and drop the Model_Boundary.gpkg into QGIS.
- 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.
- Make the 2d_code_M01_001_R layer editable by right clicking the layer and selecting 'Toggle Editing'.
- Select the Model_Boundary file by left clicking on it once in the Layers panel and use the 'Select Features' tool to highlight it.
- Select 'Edit' from the top QGIS tab and 'Copy Features' from the drop down menu.
- 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:
- 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'.
- Right click on the 'NULL' value and change the value to '1'. Click 'OK'.
- The feature ID 'fid' attribute is unique to GeoPackages. Leave this as 'Autogenerate' and QGIS will automatically assign a value.
- 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:
- Change the symbology of the 2d_code_M01_001_R layer to make it easier to work with.
- Left click the 2d_code_M01_001_R in the Layers panel to select it.
- Select ‘Apply TUFLOW Styles to Current Layer’.
- 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 |
---|
Back to Module 1 Main Page |