Difference between revisions of "TUFLOW QGIS Plugin"

From Tuflow
Jump to navigation Jump to search
Line 27: Line 27:
 
<ol>
 
<ol>
 
Please see the page for each tool.
 
Please see the page for each tool.
 +
'''Editing Tools'''<br>
 
<li> [[QGIS_TUFLOW_Create_Project | Create or Configure TUFLOW Project]]</li>
 
<li> [[QGIS_TUFLOW_Create_Project | Create or Configure TUFLOW Project]]</li>
 
<li> [[QGIS_TUFLOW_Import_Empty | Import Empty (template GIS file]]</li>
 
<li> [[QGIS_TUFLOW_Import_Empty | Import Empty (template GIS file]]</li>
 +
<li> [[QGIS_TUFLOW_Increment_Layer | Increment Selected Layer]]</li>
 +
'''Visualisation Tools'''<br>
 +
<li> [[QGIS_TUFLOW_View_Results | View Results]]</li>
 +
<li> [[QGIS_TUFLOW_View_Sections | View Cross-Sections]]</li>
 +
'''Run Tools'''<br>
 +
<li> [[QGIS_TUFLOW_Run_TUFLOW | Run TUFLOW simulation]]</li>
 
<li>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.</li>
 
<li>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.</li>
 
<li>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.
 
<li>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.

Revision as of 16:36, 8 May 2015

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 version 2.x, a previous version was available for QGIS 1.8, however, this is no longer being actively developed.

Prerequisites

The plugin uses the following python modules which may need to be separately installed. These may have been installed with other software, to check if they are installed on your machine, you can install the plugin (see instructions below) and 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. If not, you will be notified if you need to install either of the the python modules below:
Please ensure QGIS / python is installed before installing the below.

A number of other python modules are required, however, these should be installed with QGIS / python.

Installation of Plugin

    To enable the plugin please follow the instructions below:
  1. Make sure you have QGIS installed and the prerequisites installed (see above).
  2. Download the plugin, from the GitHub repository a direct link to the zip file is:
  3. https://github.com/TUFLOW-Support/QGIS-TUFLOW-Plugin/archive/master.zip
  4. Extract the zip file and then copy or move the "TUFLOW" folder into your QGIS plugin directory. This should be "C:\Users\<username>\.qgis2\python\plugins"
  5. Open QGIS and from the menu select Plugins >> Manage and Install Plugins.... In the manager, find the plugin "TUFLOW" and select the check box to enable the plugin.
  6. 300px
  7. Once enabled the plugin should be accessible from the Plugin >> TUFLOW menu item:
  8. File:QgisTuflow Menu.jpg

Usage

    Please see the page for each tool. Editing Tools
  1. Create or Configure TUFLOW Project
  2. Import Empty (template GIS file
  3. Increment Selected Layer
  4. Visualisation Tools
  5. View Results
  6. View Cross-Sections
  7. Run Tools
  8. Run TUFLOW simulation
  9. 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.
  10. 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.
  11. 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