TUFLOW QGIS Plugin: Difference between revisions
| (129 intermediate revisions by 9 users not shown) | |||
| Line 1: | Line 1: | ||
| =Introduction= | =Introduction= | ||
| If you are using QGIS as your model development or result viewing environment we strongly recommend installing the TUFLOW QGIS Plugin. It includes numerous tools to increase workflow efficiency. It also includes powerful result viewing functionality via its <u>[[TUFLOW_Viewer | TUFLOW Viewer]]</u>. This page describes the process of installing and using the Plugin.  | |||
| 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.<br><br> | |||
| <br>   | |||
| The plugin is available for both QGIS 1.8 and QGIS 2.0.  As there were some changes to the QGIS Python API [https://hub.qgis.org/wiki/17/Python_plugin_API_changes_from_18_to_20 see here for those interested] the versions are not interchangeable (though they have the same functionality).<br> | |||
| =Installation of Plugin= | |||
| <br> | |||
| =Installation= | |||
| <ol> | |||
| To enable the plugin please follow the instructions below: | To enable the plugin please follow the instructions below: | ||
| <ol> | |||
| <li>Make sure you have QGIS installed.</li> | |||
| <li>Download the plugin | <li>Download the plugin from the QGIS official repository,  '''Plugins >> Manage and Install Plugins'''</li> | ||
| [[File:QGIS_TUFLOW_000.PNG|400px]] | |||
| <li>Extract the zip file and then move the "TUFLOW" folder into your QGIS plugin directory.  This should be "C:\Users\<username>\.qgis\python\plugins"</li> | |||
| <li>In the manager, search for "TUFLOW".</li> | |||
| <li>Open QGIS and the, from the menu select Plugins >> Manage Python Plugins (for QGIS 1.8) or Plugins >> Manage and Install Plugins... (for QGIS 2.0).  In the manager, find the plugin "TUFLOW" and select the check box to enable the plugin.</li> | |||
| <li>Select TUFLOW, and "Install Plugin".</li> | |||
| [[File:QgisTuflow PluginManager.JPG|300px]] | |||
| [[File:QGIS_TUFLOW_001.PNG|400px]] | |||
| <li>Once enabled the plugin should be accessible from the '''Plugin >> TUFLOW''' menu item:</li> | |||
| <li>Once enabled the plugin should be accessible from the '''Plugins >> TUFLOW''' menu item:</li> | |||
| [[File:QgisTuflow Menu.jpg]] | |||
| [[File:QGIS_TUFLOW_003.PNG|400px]] | |||
| </ol> | |||
| <li>Before using, check that the prerequisite python modules are also installed (see below). | |||
| </ol><br> | |||
| =Development Version= | |||
| =Prerequisites= | |||
| It's possible to test out the latest development version of the plugin and TUFLOW Viewer by following the instructions below:<br> | |||
| The plugin uses the following python modules... | |||
| <b><u>[[Installing_the_Latest_Development_Version_of_the_TUFLOW_Plugin | Installing the Latest Development Version of the TUFLOW Plugin]]</u></b> | |||
| <br><br> | |||
| = Prerequisites= | |||
| =Use= | |||
| The TUFLOW 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:  | |||
| <ol> | <ol> | ||
| <li> Install the TUFLOW plugin (see instructions above)</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> Open the TUFLOW plugin '''Plugins >> TUFLOW''' </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> Check that the required dependencies are installed from the menu. '''TUFLOW >> About >> Check Python Dependencies Installed'''.  </li> | |||
| 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.<br> | |||
| [[File:QGIS_TUFLOW_004.PNG|600px]] | |||
| '''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.</li> | |||
| <li>After configuring the project ensure you save your project.</li> | |||
| </ol> | </ol> | ||
| [[File:QgisTuflow Configure01.JPG|400px]] | |||
| 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 python modules below:<br> | |||
| ==Create TUFLOW directory== | |||
| Please ensure QGIS / python is installed before installing the below.<br> | |||
| 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.<br> | |||
| * numpy (see https://sourceforge.net/projects/numpy/files/NumPy/1.6.1/numpy-1.6.1-win32-superpack-python2.7.exe/download) | |||
| [[File:QgisTuflow CreateDirectory.JPG|400px]] | |||
| * matplotlib (see https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.0/matplotlib-1.1.0.win32-py2.7.exe/download) | |||
| <br> | |||
| <br> | <br> | ||
| 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.<br> | |||
| Multiple empty types and geometries can be imported at the same time.<br> | |||
| =Usage= | |||
| [[File:QgisTuflow ImportEmpty01.JPG]] | |||
| Each function in the utility has a separate page documenting the usage.  | |||
| The first step for a project is to create the project / save the settings with the [[QGIS_TUFLOW_Create_Project | Create or Configure TUFLOW Project]] tool.  Subsequent tools rely on the information stored at this stage to work best.  | |||
| === Editing Tools === | |||
| <ol> | |||
| <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_Insert_TUFLOW_Attributes_to_Existing_Layer | Insert TUFLOW Attributes to Existing Layer]]</li> | |||
| <li> [[QGIS_TUFLOW_Increment_Layer | Increment Selected Layer]]</li> | |||
| <li> [[QGIS_TUFLOW_Reload_Data | Reload Data]] | |||
| <li> [[QGIS_TUFLOW_Arch_Bridge_Editor | Arch Bridge Editor]] | |||
| <li> [[QGIS_TUFLOW_Copy_TUFLOW_Command | Copy TUFLOW Command]] | |||
| </ol> | |||
| === Run Tools === | |||
| <ol> | |||
| <li> [[QGIS_TUFLOW_Run_TUFLOW | Run TUFLOW simulation]]</li> | |||
| <li> [[TUFLOW_Runner | TUFLOW Runner]]</li> | |||
| <li> [[QGIS_TUFLOW_Run_TUFLOW_Utilities | Running TUFLOW Utilities]]</li> | |||
| </ol> | |||
| === Visualisation Tools === | |||
| <ol> | |||
| <li> [[TUFLOW_Viewer | TUFLOW Viewer ]](result visualisation toolkit) | |||
| <li> [[QGIS_TUFLOW_Styles | Applying TUFLOW styles]] | |||
| <li> [[QGIS_TUFLOW_Import_Check_Files_From_Folder | Import Check Files From Folder]] | |||
| <li> [[QGIS_TUFLOW_Load_Layers_From_TCF | Load TUFLOW Layers From TCF]] | |||
| <li> [[QGIS_TUFLOW_Filter_and_Sort_TUFLOW_Layers | Filter and Sort TUFLOW Layers]] | |||
| <li> [[QGIS_TUFLOW_Apply_GPKG_Layer_Names | Apply GPKG Layer Names]] | |||
| <li> [[QGIS_TUFLOW_Apply_Label_to_Current_Layer | Apply Label to Current Layer]] | |||
| <li> [[QGIS_TUFLOW_Apply_Stability_Styling | Apply Stability Styling]] | |||
| </ol> | |||
| === Hydrology Tools === | |||
| <ol> | |||
| <li> [[QGIS_ARR_to_TUFLOW | ARR to TUFLOW]] | |||
| <li> [[QGIS_ReFH2_to_TUFLOW | ReFH2 to TUFLOW]] | |||
| <li> [[QGIS_SCS_to_TUFLOW | SCS to TUFLOW]] | |||
| </ol> | |||
| === Integrity Tools === | |||
| <ol> | |||
| <li> [[1D_Integrity_Tool | 1D Integrity Tool]] | |||
| </ol> | |||
| === SWAN GIS Tools === | |||
| For more information on SWAN GIS Tools please visit the following TUFLOW FV Wiki page: '''<u>[https://fvwiki.tuflow.com/index.php?title=SWAN_GIS_Tools SWAN GIS Tools]</u>'''. Links to the individual tools on the TUFLOW FV Wiki area also provided below: | |||
| <ol> | |||
| <li> [https://fvwiki.tuflow.com/index.php?title=SWAN_GIS_Model_Builder SWAN GIS Model Builder] | |||
| <li> [https://fvwiki.tuflow.com/index.php?title=SWAN_GIS_Post_Processing SWAN GIS Post Processing] | |||
| </ol> | |||
| === Processing Toolbox === | |||
| <ol> | |||
| <li> [[Convert_TUFLOW_Model_GIS_Format | Convert TUFLOW Model GIS Format]] | |||
| <li> [[Create_TUFLOW_Project | Create TUFLOW Project]] | |||
| <li> [[Package_Model_in_QGIS | Package Model]] | |||
| <li> [[QGIS_TIN_Polygons_Assign_Elevations | TIN Polygons - Assign Elevations]] | |||
| <li> SWMM Tools: | |||
| <ol><li>[[QGIS_SWMM_BC_Create_Channel_Endpoint_1D/2D_Connections | BC - Create channel endpoint 1D/2D connections]] | |||
| <li> [[QGIS_SWMM_Conduits_Assign_Losses | Conduits - Assign losses]] | |||
| <li> [[QGIS_SWMM_Conduits_Assign_Node_Fields | Conduits - Assign node fields]] | |||
| <li> [[QGIS_SWMM_Convert_ESTRY_Layers_To_SWMM | Convert - ESTRY layers to SWMM]] | |||
| <li> [[QGIS_SWMM_Convert_XPSWMM_GIS_Inlet_Layers_to_SWMM | Convert - XPSWMM GIS inlet layers to SWMM]] | |||
| <li> [[QGIS_SWMM_Convert_XPSWMM_Hydrology_(beta) | Convert - XPSWMM Hydrology (beta)]] | |||
| <li> [[QGIS_SWMM_Convert_XPSWMM_Model_From_XPX | Convert - XPSWMM model from XPX (beta)]] | |||
| <li> [[QGIS_SWMM_GeoPackage_Add_Sections | GeoPackage - Add sections]] | |||
| <li> [[QGIS_SWMM_GeoPackage_Create | GeoPackage - Create]] | |||
| <li> [[QGIS_SWMM_GeoPackage_Create_from_SWMM_inp | GeoPackage - Create from SWMM inp]] | |||
| <li> [[QGIS_SWMM_GeoPackage_Write_to_SWMM_inp | GeoPackage - Write to SWMM inp]] | |||
| <li> [[QGIS_SWMM_Integrity_Make_Object_Names_Unique| Integrity - Make object names unique]] | |||
| <li> [[QGIS_SWMM_Junctions_Convert_HX_Nodes_to_Storage| Junctions - Convert HX nodes to storage]] | |||
| <li> [[QGIS_SWMM_Junctions_Downstream_Junctions_to_Outfalls| Junctions - Downstream junctions to outfalls]] | |||
| <li> [[QGIS_SWMM_Junctions_Set_Attributes| Junctions - Set attributes]] | |||
| <li> [[QGIS_SWMM_Outfalls_Fix_Multiply_Connected_Links| Outfalls - Fix multiply connected links]] | |||
| </ol> | |||
| </ol> | |||
| If you encounter any issues with the plugin please contact <u>[mailto:support@tuflow.com support@tuflow.com]</u>.<br> | |||
| <br> | <br> | ||
| <br> | |||
| '''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.<br> | |||
| [[File:QgisTuflow Increment01.JPG]] | |||
| <br> | |||
| ==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.<br> | |||
| 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.<br> | |||
| 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).<br> | |||
| 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.<br> | |||
| See images below. | |||
| [[File:QgisTuflow ResViewer001.JPG|400px]] | |||
| [[File:QgisTuflow ResViewer002.JPG|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. | |||
| [[File:QgisTuflow XSViewer001.JPG|400px]] | |||
| =Error While Upgrading Plugin= | |||
| ==Run TUFLOW Simulation== | |||
| [[File:Plugin_uninstall_failed.PNG]]<br> | |||
| 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. | |||
| If you receive an error while trying to upgrade the TUFLOW plugin you may need to either:<br> | |||
| [[File:QgisTuflow RunTUFLOW01.JPG]] | |||
| <ol> | |||
| <li> Restart QGIS and try upgrading the plugin again | |||
| <li> Manually remove the old version | |||
| </ol> | |||
| Errors are most likely caused by an issue with deleting the old version of the plugin as some part of the plugin is still being used somewhere in memory (RAM) and locking permissions. This is a known issue that occur with the ReFH2 to TUFLOW tool in older versions of the plugin. Simply restarting QGIS and retrying the upgrade process should fix the issue. | |||
| === Manually removing the TUFLOW plugin === | |||
| To manually remove the TUFLOW plugin simply delete the 'tuflow' folder from the QGIS plugin directory (you may need to close QGIS first):<br> | |||
| <ol> | |||
| <li>'''Windows''' - %appdata%\QGIS\QGIS3\profiles\default\python\plugins | |||
| <li>'''Linux''' - /home/USER/.local/share/QGIS/QGIS3/profiles/default/python/plugins | |||
| </ol> | |||
| =Changelog= | |||
| [https://docs.tuflow.com/qgis-tuflow-plugin/changelog/ https://docs.tuflow.com/qgis-tuflow-plugin/changelog/] | |||
| <br> | |||
| {{Tips Navigation | |||
| |uplink=[[QGIS_Tips| Back to QGIS Tips Main Page]] | |||
| }} | |||
| <br><br><br><br> | |||
| {{Tips Navigation | |||
| |uplink=[[Main_Page| Back to Wiki Main Page]] | |||
| }} | |||
Latest revision as of 10:08, 12 February 2025
Introduction
If you are using QGIS as your model development or result viewing environment we strongly recommend installing the TUFLOW QGIS Plugin. It includes numerous tools to increase workflow efficiency. It also includes powerful result viewing functionality via its  TUFLOW Viewer. This page describes the process of installing and using the Plugin. 
  
Installation of Plugin
To enable the plugin please follow the instructions below:
- Download the plugin from the QGIS official repository, Plugins >> Manage and Install Plugins
- In the manager, search for "TUFLOW".
- Select TUFLOW, and "Install Plugin".
- Once enabled the plugin should be accessible from the Plugins >> TUFLOW menu item:
- Before using, check that the prerequisite python modules are also installed (see below).
Development Version
It's possible to test out the latest development version of the plugin and TUFLOW Viewer by following the instructions below:
 Installing the Latest Development Version of the TUFLOW Plugin
Prerequisites
The TUFLOW 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:
- Install the TUFLOW plugin (see instructions above)
- Open the TUFLOW plugin Plugins >> TUFLOW
- Check that the required dependencies are installed from the menu. TUFLOW >> About >> Check Python Dependencies Installed.
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 python modules below:
Please ensure QGIS / python is installed before installing the below.
- numpy (see https://sourceforge.net/projects/numpy/files/NumPy/1.6.1/numpy-1.6.1-win32-superpack-python2.7.exe/download)
- matplotlib (see https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.0/matplotlib-1.1.0.win32-py2.7.exe/download)
Usage
Each function in the utility has a separate page documenting the usage.
The first step for a project is to create the project / save the settings with the Create or Configure TUFLOW Project tool. Subsequent tools rely on the information stored at this stage to work best.
Editing Tools
- Create or Configure TUFLOW Project
- Import Empty (template GIS file)
- Insert TUFLOW Attributes to Existing Layer
- Increment Selected Layer
- Reload Data
- Arch Bridge Editor
- Copy TUFLOW Command
Run Tools
Visualisation Tools
- TUFLOW Viewer (result visualisation toolkit)
- Applying TUFLOW styles
- Import Check Files From Folder
- Load TUFLOW Layers From TCF
- Filter and Sort TUFLOW Layers
- Apply GPKG Layer Names
- Apply Label to Current Layer
- Apply Stability Styling
Hydrology Tools
Integrity Tools
SWAN GIS Tools
For more information on SWAN GIS Tools please visit the following TUFLOW FV Wiki page: SWAN GIS Tools. Links to the individual tools on the TUFLOW FV Wiki area also provided below:
Processing Toolbox
- Convert TUFLOW Model GIS Format
- Create TUFLOW Project
- Package Model
- TIN Polygons - Assign Elevations
-  SWMM Tools:
- BC - Create channel endpoint 1D/2D connections
- Conduits - Assign losses
- Conduits - Assign node fields
- Convert - ESTRY layers to SWMM
- Convert - XPSWMM GIS inlet layers to SWMM
- Convert - XPSWMM Hydrology (beta)
- Convert - XPSWMM model from XPX (beta)
- GeoPackage - Add sections
- GeoPackage - Create
- GeoPackage - Create from SWMM inp
- GeoPackage - Write to SWMM inp
- Integrity - Make object names unique
- Junctions - Convert HX nodes to storage
- Junctions - Downstream junctions to outfalls
- Junctions - Set attributes
- Outfalls - Fix multiply connected links
 
If you encounter any issues with the plugin please contact support@tuflow.com.
Error While Upgrading Plugin
If you receive an error while trying to upgrade the TUFLOW plugin you may need to either:
- Restart QGIS and try upgrading the plugin again
- Manually remove the old version
Errors are most likely caused by an issue with deleting the old version of the plugin as some part of the plugin is still being used somewhere in memory (RAM) and locking permissions. This is a known issue that occur with the ReFH2 to TUFLOW tool in older versions of the plugin. Simply restarting QGIS and retrying the upgrade process should fix the issue.
Manually removing the TUFLOW plugin
To manually remove the TUFLOW plugin simply delete the 'tuflow' folder from the QGIS plugin directory (you may need to close QGIS first):
- Windows - %appdata%\QGIS\QGIS3\profiles\default\python\plugins
- Linux - /home/USER/.local/share/QGIS/QGIS3/profiles/default/python/plugins
Changelog
https://docs.tuflow.com/qgis-tuflow-plugin/changelog/
| Up | 
|---|
|  Back to QGIS Tips Main Page | 
| Up | 
|---|
|  Back to Wiki Main Page |