Home
Random
Recent changes
Special pages
Community portal
Settings
About Tuflow
Disclaimers
Tuflow
Search
User menu
Log in
View source for Tute M03 QGIS 2d zsh Archive
←
Tute M03 QGIS 2d zsh Archive
<ol> =Introduction= In this page, we import data from text file format into a QGIS file. Once the data is in QGIS format we will manipulate into a TUFLOW 2d Z Shape (2d_zsh) format ready for input into TUFLOW. =Method= Two separate sets of data have been provided in the '''\Module_Data\Module_03\'''. These are simple text files with the .xyz extension, as the name suggest these contain coordinates in a x, y and z format. In this case they are comma separated. A similar process could be used for space or tab delimited data. ==Importing Text Data== The first step is to import that data into QGIS, to do this:<br> <ol> <li>In QGIS select ''Layer >> Add Delimited Text Data'' from the menu items.</li> <li>Navigate to the '''Module_Data\Module_03\''' folder.</li> <li>In the '''Files of Type:''' drop down box, select '''Text files (*.txt *.csv)'''.</li> <li>As the files have the extension .xyz not .txt, type "*.*" into the '''Filename''' section and hit enter.</li> <li>The .xyz files should now be visible, select the '''Creek_Centre_Line.xyz''' and select ''Open''.</li> [[File:Tute M03 QGIS ImportXYZ 01.png|frame|none]] <br> <li>In the next dialogue the delimiter character can be specified, in this case it is a comma (","). Select the X and Y fields to X and Y respectively, as per the image below. Select OK.</li> [[File:Tute M03 QGIS ImportXYZ 02.png|frame|none]] <br> <li>The file should have opened and have point objects down the creek. If it is not already open the DEM ensure that the points are being displayed onto of the DEM. The points should appear as per the image below, with the points having X, Y and Z attributes. The next step is to manipulate the shapefile into a TUFLOW file format.</li> [[File:Tute M03 QGIS ImportXYZ 03.png|frame|none]] <br> </ol> ==2d Z Shape Format== <ol> <li>Save a copy of the '''Creek_Centre_Line_XYZ''' into the '''TUFLOW\model\gis\''' as '''2d_zsh_M03_thalweg_001_P.shp'''.</li> <li>Close the '''Creek_Centre_Line_XYZ''' file down and open the '''2d_zsh_M03_thalweg_001_P.shp''' file.</li> <li>We need to set the projection (coordinate reference system), to do this, right click on the 2d_zsh_M03_thalweg_001_P in the layer control and select ''Set Layer CRS''.</li> <li>In the dialogue specify the CRS as 'WGS 84 / UTM Zone 60 S. This is the projection of the TUFLOW model that we set in module 1.</li> :'''Tip:''' This should be in the recently used section at the bottom of the dialogue. [[File:Tute M01 QGIS projection2.png | frame | none ]] <br> The 2d Z Shape (2d_zsh) format requires the input data to be in the format outlined in the <u>[https://docs.tuflow.com/classic-hpc/manual/latest/ TUFLOW Manual]</u>. The first four columns of the table should contain the following attributes:<br> * Z * dZ * Shape_Width_or_dMax * Shape_Options The first three are numerical fields ("real" type in QGIS) and the fourth a character field of length 20. The table can have additional columns, these will be ignored by TUFLOW.<br> <li>The file already has a "Z" attribute, but we need to add three additional fields, "dZ" (real), "Shape_Width_or_dMax (real) and Shape_Options (character - length 20). To create these fields, right click on the file in the layer control and select, ''Properties''.</li> <li>In the Layer Properties dialogue, navigate to the '''Fields''' tab and toggle editing on. Select the '''New Column''' button and create the three fields as per the images below.</li> [[File:Tute M03 QGIS 2d zsh 01.png|frame|none]] [[File:Tute M03 QGIS 2d zsh 02.png|frame|none]] [[File:Tute M03 QGIS 2d zsh 03.png|frame|none]] [[File:Tute M03 QGIS 2d zsh 04.png|frame|none]] <br> <li>To manipulate the order of the attributes in QGIS, we need to install a plugin. To do this, please install the "Table Manager" plugin using the method outlined in the [[QGIS_Table_Manager | Table Manager Plugin]] page.</li> <li>Once the plugin has been installed, select ''Plugins >>> Table >>> Table Manager''. Using the Move Up and Move Down buttons, move the X and Y columns so the table has the following structure:</li> [[File:Tute M03 QGIS 2d zsh 05.png|frame|none]] <br> <li>The data contains only points, no lines have been provided, we will need to digitise these. To do this we need to create a line file in the 2d_zsh format. Open the '''2d_zsh_empty_L.shp''' file from the '''TUFLOW\model\gis\empty\''' folder and save a copy as ''''''2d_zsh_M03_thalweg_001_L.shp''' close the template (empty) file and open the 2d_zsh_M03_thalweg_001_L file.</li> <li>We are going to create a line that joins the points together, this will need to snap to the points, make sure the points have snapping enable in the ''Settings >>> Snapping Options''' dialogue.</li> <li>Starting at the upstream end, create a polyline joining the points together. The line should snap to all of the points. Make sure to terminate the line and restart it upstream and downstream of the road embankments.</li> :'''Tip:''' If you make a mistake the backspace key can be used to remove the last vertex digitised. [[File:Tute M03 QGIS 2d zsh 06.png|frame|none]] <br> <li>For each of the lines, set the following attribute: * Z = 99 (this won't be used as the elevation data is provided in the points) * dZ = 0 * Shape_Width_or_dMax = 0 * Shape_Options = Min</li> The "MIN" in the shape options only lowers the elevations if the elevation from the breakline is below the the existing elevations in the Zpts. "MIN", "LOWER" and "GULLY" all perform the same function. This will lower a continuous flowpath, by lowering cell centres and cell sides. We will examine the changes made to the model in the check file section later in this tutorial module.<br> The breakline to represent the creek centre line is now ready for input into TUFLOW.<br> <li>Repeat the process described above: * Import the '''Road_Crest_Survey.xyz''' and create a new file called '''2d_zsh_M03_Rd_Crest_001_P''' in the '''TUFLOW\model\gis\''' directory; * Modify the table structure to match the 2d_zsh format; and * Create a new line layer from the '''2d_zsh_empty_L.shp''' empty file named '''2d_zsh_M03_Rd_Crest_001_L''' in the '''TUFLOW\model\gis\''' directory; * Digitise three lines, one for each road, as per the image below.</li> [[File:Tute M03 MI 2d zsh 05.png|frame|none]] <br> <li>On the lines shown above, enter the following attributes: {| align="center" class="wikitable" width="40%" ! style="background-color:#005581; font-weight:bold; color:white;"| GIS Attribute ! style="background-color:#005581; font-weight:bold; color:white;" width=20%| Line 1 ! style="background-color:#005581; font-weight:bold; color:white;" width=20%| Line 2 ! style="background-color:#005581; font-weight:bold; color:white;" width=20%| Line 3 |- align="center" ! style="background-color:#005581; font-weight:bold; color:white;"| Z ! style="font-weight:normal;"| 99 ! style="font-weight:normal;"| 99 ! style="font-weight:normal;"| 99 |- align="center" ! style="background-color:#005581; font-weight:bold; color:white;"| dZ ! style="font-weight:normal;"| 0 ! style="font-weight:normal;"| 0 ! style="font-weight:normal;"| 0 |- align="center" ! style="background-color:#005581; font-weight:bold; color:white;"| Shape_Width_or_dMax ! style="font-weight:normal;"| 5 ! style="font-weight:normal;"| 0 ! style="font-weight:normal;"| 0 |- align="center" ! style="background-color:#005581; font-weight:bold; color:white;"| Shape_Options ! style="font-weight:normal;"| MAX ! style="font-weight:normal;"| MAX ! style="font-weight:normal;"| MAX |} As per the creek line above, the elevations are associated with the points and a dummy value of 99 is used on the line (the actual value is unimportant). If no points are in the layer, the elevation on the line object is used, i.e. the elevation along the line does not vary.<br> As explained in the <u>[https://docs.tuflow.com/classic-hpc/manual/latest/ TUFLOW Manual]</u>, for a line object the Shape_Width_or_dMax, controls the width of the breakline in metres. Depending on the cell size the following methods of application are used:<br> * Shape_Width_or_dMax = 0 - a "thin" breakline is used, only elevations on the cell side are modified (no change in storage); * Shape_Width_or_dMax less than or equal to 1.5 times the cell size - a line of whole cells are modified (a "thick" breakline); or * Shape_Width_or_dMax greater the 1.5 times the cell size - a "wide" breakline, elevations in multiple cells are modified. Any Zpts within a distance of half the Shape_Width_or_dMax are modified. For the tutorial model a cell size of 5m is used, therefore, line 1 will be a "thick" formulation and line 2 and line 3 will be using a "thin" breakline. Later in the module we will looking at the check files to review which Zpts are modified. </ol> =Conclusion= Two datasets have been imported into QGIS and manipulated into a TUFLOW Z Shape format (2d_zsh). The next step is to modify the control files, [[Tutorial_Module03_Archive#Modify_Simulation_Control_Files | please return to the module 3 page]]. </ol>
Return to
Tute M03 QGIS 2d zsh Archive
.