TUFLOW QGIS Plugin

From Tuflow
Revision as of 10:40, 16 January 2014 by Par (talk | contribs)
Jump to navigation Jump to search

Introduction

This page describes the process of running the TUFLOW QGIS plugin. At this stage it is still a beta and once we have tested it further it will be made available for the official QGIS repository... Please report any issues or feedback to support@tuflow.com.

The plugin is available for both QGIS 1.8 and QGIS 2.0. As there were some changes to the QGIS Python API see here for those interested the versions are not interchangeable (though they have the same functionality).

Installation

    To enable the plugin please follow the instuctions below:
  1. Download the plugin...

Prerequisites

The plugin uses the following python modules...

Use

  1. Step 1 is to check that the required dependencies are installed. To do this run TUFLOW > About > Check Python Dependencies Installed from the menu. All going well you will get a notification to tell you that the required modules are installed.
  2. The next step is to configure a TUFLOW project. This is project dependent and stores the location of the TUFLOW executable, working directory and projection. This can be accessed from TUFLOW > Editing > Configure TUFLOW Project. This saves the information in the QGIS project. This information is used later, for example when you use the Run TUFLOW, the utility defaults to running the most recent .tcf file in the specified TUFLOW directory, defined at this step.
    Note: The location specified, should be the folder that contains (or will contain) the TUFLOW folder. For example if the TUFLOW directory is "L:\Projects\Dummy\Modelling\TUFLOW\" then "L:\Projects\Dummy\Modelling\" should be defined in this dialogue.
  3. After configuring the project ensure you save your project.

400px

Create TUFLOW directory

The first step in creating a TUFLOW model is typically to create a TUFLOW directory structure, define a projection file and run TUFLOW to create the empty (template) TUFLOW files. This can be done in a single step using the TUFLOW > Editing > Create TUFLOW directory tool.
400px

The TUFLOW folder will be created under this location. If the "Run TUFLOW to create empties" is checked, after creating the folder structure, a TUFLOW simulation will be started which creates the empty (template) files under the "TUFLOW\model\gis\empty\" folder.

Import Empty File

This tool will grab a default TUFLOW type (e.g. 1d_bc or 2d_zsh) copy this from TUFLOW\model\gis\empty\ into TUFLOW\model\gis and rename the file. The output name is "file type"+"Run ID"+Geometry.shp. For example 2d_zsh_run01_L.shp for a line, 2d_zsh_run01_P.shp for a point or 2d_zsh_run01_R.shp for region. The file will be opened and added to the layers.
Multiple empty types and geometries can be imported at the same time.

File:QgisTuflow ImportEmpty01.JPG

Note: Not all geometry types exist for all TUFLOW types. For example 1d_bc, points and regions are valid, however lines are not. For more information on the TUFLOW empty types, please refer to the tables in the TUFLOW manual.

Increment Selected

As the name implies, this tool, takes the active layer (selected in the layer control) and saves a new copy of this. The current copy will be closed and the new version opened. There is an option to keep the existing source formatting, if this is selected a .qml file is saved based on the styling of the current layer.
File:QgisTuflow Increment01.JPG

View 1D Results

This allows the user to view 1D results as time-series or long profiles. This requires that the results are from a 2013-12-AA simulation or newer. Once the utility is started the results can be loaded using the "Add Results" button. The .info file (TUFLOW\results\1d\csv\) is the file to load, this tells the utility which .csv files need to be loaded.
When using the utility the ID of the selected GIS objects is used to find the results in the .csv files. This can either be an input file (1d_nwk) or the check files. The _nwk_N_check (contains all nodes) and and _nwk_C_check (contains all channels) are very useful for this purpose.
If a file containing lines is selected in the layer control, the utility allows viewing of channel data (time-series of flow, velocity and upstream and downstream water levels or long profiles). If a point geometry is selected, the utility will plot the node data (time-series of water level).
Multiple locations can be selected in the map window and these will be plotted. If viewing long profiles, the following logic applies:

  • If a single channel is selected, all channels downstream will be plotted;
  • If two channels are selected, a long section will be plotted between these;
  • If more than two channels are selected an error will be issued.

See images below. 400px 300px

View 1D Sections

This allows the user to plot 1D sections, in the 1d_xs or 1d_tab format. The active layer in the table of contents should be the layer contain the cross sections. Select a section or sections in the map window will plot the sections. 400px

Run TUFLOW Simulation

Start a TUFLOW simulation. The default control file is the most recent file in the TUFLOW\runs\ folder, the default executable is defined in the "Configure TUFLOW project". If the "Configure TUFLOW project" tool has not been run, no default values exist. QgisTuflow RunTUFLOW01.JPG