Difference between revisions of "InfoWorks ICM to TUFLOW"

From Tuflow
Jump to navigation Jump to search
(Created page with "=Introduction= This page outlines an approach for conversion of an infoWorks ICm model to an Estry/TUFLOW format so that the 1D and 2D networks can be replicated in TUFLOW and...")
 
 
(73 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
'''Page In Progress'''
 +
 
=Introduction=
 
=Introduction=
This page outlines an approach for conversion of an infoWorks ICm model to an Estry/TUFLOW format so that the 1D and 2D networks can be replicated in TUFLOW and used to generate a TUFLOW model.<br>
+
This page outlines an approach for conversion of an InfoWorks ICM model to an Estry/TUFLOW format so that the 1D and 2D networks can be replicated in TUFLOW and used to generate a TUFLOW model.<br>
  
 
=InfoWorks ICM Network Conversion=
 
=InfoWorks ICM Network Conversion=
  
 
The InfoWorks data formats are native and therefore do require access to InfoWorks in order to convert the data.  Note, that the following steps can be undertaken with a InfoWorks ICM Viewer licence and a full licence is not currently required.
 
The InfoWorks data formats are native and therefore do require access to InfoWorks in order to convert the data.  Note, that the following steps can be undertaken with a InfoWorks ICM Viewer licence and a full licence is not currently required.
Although the InfoWorks ICM data formats are proprietry, it is relatively easy to use the Open Data Export Centre within InfoWorks ICM to export the model geometry data to open GIS layer formats (both shapefile and MIF/Mid format).  The following steps will outline exporting to shapefiles but similar can be undertaken for MIF/MID.  
+
Although the InfoWorks ICM data formats are proprietry, it is relatively easy to use the Open Data Export Centre within InfoWorks ICM to export the model geometry data to open GIS layer formats (both shapefile and MIF/MID format).  The following steps will outline exporting to shapefiles but similar can be undertaken for MIF/MID.  
To open the Open Data Export Centre in InfoWorks ICM, open your network in the geoplan, select the relevant scenario, and go to Network->Export->Using Open Date Export Centre.  You’ll be presented with the following dialog which allows you to export the InfoWorks network data to a variety of formats.
+
To open the Open Data Export Centre in InfoWorks ICM, open your network in the geoplan, select the relevant scenario, and go to '''Network->Export->Using Open Data Export Centre'''.  You’ll be presented with the following dialog which allows you to export the InfoWorks network data to a variety of formats.
 +
 
 +
[[File:ODEC.png|400px]]
  
 
The data in InfoWorks ICM is stored in a number of database tables for each network type (eg, a separate table for nodes, conduits, 2D zones etc…).
 
The data in InfoWorks ICM is stored in a number of database tables for each network type (eg, a separate table for nodes, conduits, 2D zones etc…).
Line 12: Line 16:
 
==Quick Export of Geometry Data==
 
==Quick Export of Geometry Data==
  
To get a quick idea of the 1D network, it’s possible to export 2 tables, ‘All Links’ and ‘All Nodes’Set the Export type to ‘Shape File’ and select ‘Automap’ to export the InfoWorks fieldsProvide a filename and save location and click Export.
+
To get a full export of all the model files, with InfoWorks file formats, open the network and go to '''Network->Export->to Shape Files''', select the save location and the InfoWorks tables that you're interested in.  Once exported the shape files can be opened in GIS to view the network table geometry and parametersOnce the data is exported, it's possible to sue the QGIS TUFLOW Plugin 'Insert TUFLOW Attributes to Existing GIS Layer' and then map across the field values from InfoWorks to TUFLOW with conversion as required.
 +
 
 +
A Ruby script is also available which will export export all data via the Open Data Export Centre without the need for the user to export each table individuallyThe data can use a config file to undertake some of the mapping of field values and some conversion.
  
Once exported the two shape files can be opened in GIS to view the network links and nodes.
+
==Use of Ruby Scripts==
  
==Export to TUFLOW Formats==
+
It’s possible to utilise the Ruby Scripting interface within InfoWorks ICM to speed up the export.  A ruby script can be run to call the Open Data Export Centre, and export all requested tables, using a specified config file automatically, significantly reducing the number of button clicks.  An example Ruby Script is available from <u>[https://gitlab.com/tuflow-user-group/tuflow/model-conversions/infoworks-icm TUFLOW Gitlab User Group]</u> which exports all tables and data in an InfoWorks format.
  
Within the Open Data Export Centre, it is possible to provide the Export Field Names and to map to them from the internal fields within the InfoWorks tables.  This allows you to export directly to a shapefile with a TUFLOW formatFor example, in the below image, the Export fields are set up to replicate the TUFLOW 1d_nwk file formatThe relevant InfoWorks fields are then mapped to these to convert the InfoWorks format to a TUFLOW shapefile format.
+
To run the script, you’ll again need to run InfoWorks ICM with a viewer licence or greaterWith the desired network in the geoplan, go to '''Network->Run Ruby Script'''Navigate to and select the ruby script, in the below this is ICM_Out_to_shp_1.rb.
  
Once the mappings have been set up, they can be saved as a Config file by using the ‘Save Config…’ option.  Once a copy has been saved, the config file can be re-used to apply the same field mappings to subsequent exports.  It should be noted that not all TUFLOW fields have an equivalent InfoWorks field and vice versa, therefore in some situations there will be some modeller input required to ensure the data is imported in the correct manner.  It is also possible to export all InfoWorks fields at the end of the shape file and then use GIS to post-process this for conversions and other simple translations (for example set the TUFLOW pipe type to ‘C’ of the InfoWorks Shape type is ‘Circ’).  Please contact support@tuflow.com for an example config file which contains mappings for nodes, pipes, 2D components and 1D structures.  The config file is a work in progress but provides a good starting point for the conversion and further mapping of fields between InfoWorks and TUFLOW.  Note, that currently the config file is set up to export geometry tables only and will not export tables containing cross-sections, head-discharge curves and similar.
+
[[File:Ruby.png|400px]]
  
This approach can be used to export on a table by table approach although it is possible to save to the same config file.  This allows one config file to set up all the mappings for each of the table exports.  The downside of this approach is the time-consuming nature of exporting each table individually.
+
The script will then begin running and prompt the user to select a config file.  Navigate and select the relevant config file.
  
==Use of Ruby Scrips==
+
[[File:Config.png|400px]]
  
It’s possible to utilise the Ruby Scripting interface within InfoWorks ICM to speed up the exportA ruby script can be run to call the Open Data Export Centre, and export all requested tables, using a specified config file automatically, significantly reducing the number of button clicksAn example Ruby Script is available from support@tuflow.com which exports the tables as shown in Table 1.
+
The user will then be prompted where they would like to export the data too.  Select an appropriate file directoryThe ruby script will then cycle through the list of tables within the script and export the tables automatically.  Once complete the script will return a log highlighting the location of the exported filesAll network objects are exported regardless of system type.  System type is exported as an additional field in the shape files to enable filtering within GIS as required.
  
To run the script, you’ll again need to run InfoWorks ICM with a viewer licence or greater.  With the desired network in the geoplan, go to Network->Run Ruby Script.  Navigate to and select the ruby script.
+
[[File:Ruby log message.png|400px]]
  
The script will then begin running and prompt the user to select a config fileNavigate and select the relevant config file.
+
The exported shape files can then be opened in GIS for further inspection and once checked can be linked together using the various TUFLOW control filesA set of generic control files for this are in progress.
 +
 
 +
'''InfoWorks ICM Network'''<br>
 +
[[File:ICM network.png|400px]]
 +
 
 +
'''TUFLOW Network'''<br>
 +
[[File:TUFLOW network.png|400px]]
  
The user will then be prompted where they would like to export the data too.  Select an appropriate file directory.  The ruby script will then cycle through the list of tables within the script and export the tables automaticallyOnce complete the script will return a log highlighting the location of the exported files. All network objects are exported regardless of system type. System type is exported as an additional field in the shape files to enable filtering within GIS as required.
+
=Exporting Real Time Control=
 +
Operational Control is referred to as Real Time Control (RTC) in InfoWorks.  The ruby script above will export the RTC as a text file called [Network_Name]_ICM_RTC.txt which can be used as the basis to generate the TUFLOW Operational Control file.  The RTC is made up of the object that is being controlled, the defined ranges in which the structure operates and the desired operationFor example in the below example, the sluice gate, Storm1_Chamber.1, will be set to an 'On' position of 0.2m if the height above datum at FORAST_CSO is below 32.3m AD and will be set to an 'Off' position of 0m if the water level is above 32.3m AD.
  
These files can then be opened in GIS for further inspection and once checked can be linked together using the various TUFLOW control files.  A set of generic control files for this are in progress.
+
[[File:RTC.PNG]]
  
==Exporting a River Reach==
+
This can be written using TUFLOW Operation Control rules as the following:-
  
The steps above will export the river reach links into a shape file formatThese contain the location of the individual reaches and are equivalent to the 1d_nwk_l within TUFLOWTo export River Sections, within InfoWorks you'll need to use an SQL to export the cross-section data (note this is slightly different to river section data). In progress.
+
<font color="blue"><tt>Define Sluice </tt></font> <font color="red"><tt>==</tt></font> Storm1_Chamber.1
 +
  WSE <font color="red"><tt>==</tt></font> H1D FORAST_CSO
 +
<font color="blue"><tt>IF</tt></font> WSE < 32.3
 +
  Gate Opening <font color="red"><tt>==</tt></font> 0.2
 +
  <font color="blue"><tt>ELSE</tt></font>
 +
  Gate Opening <font color="red"><tt>==</tt></font> 0
 +
  <font color="blue"><tt>END IF</tt></font>
  
 
=Exporting Boundary Conditions=
 
=Exporting Boundary Conditions=
  
Inflow, level and rainfall boundaries are all held in separate database objects within InfoWorks.  To export, open the relevant object (for generated rainfall you’ll need to Open as…->Grid Editor (TVD Read only), select all the data and copy into a spreadsheet to save into a .csv file format.  The .csv can then be modified to put it into a TUFLOW format and a bc_dbase file generated to relate the time-varying data to the relevant model node.
+
Inflow, level and rainfall boundaries are all held in separate database objects within InfoWorks.  These can be exported directly to .csv file format which can then be modified to put it into a TUFLOW format and a bc_dbase file generated to relate the time-varying data to the relevant model node.
 +
 
 +
'''InfoWorks ICM Rainfall Time-Varying Data'''<br>
 +
[[File:ICM Boundary data.png|400px]]
 +
 
 +
'''TUFLOW Rainfall Boundary Time-Varying Data'''<br>
 +
[[File:TUFLOW Boundary data.png|400px]]
  
 
=Exporting a Gridded Ground model=
 
=Exporting a Gridded Ground model=
  
Within InfoWorks, select the gridded ground model, right click and choose Export->to ESRI ASCII grid files.  This will export into a file format that can be directly used within TUFLOW.
+
Within InfoWorks, select the gridded ground model, right click and choose '''Export->to ESRI ASCII grid files'''.  This will export into a file format that can be directly used within TUFLOW.
  
 
=Other Considerations=
 
=Other Considerations=
  
Real Time Control (RTC) objects in InfoWorks will need to be rewritten as TUFLOW operational control rules with TUFLOW Operation Control (TOC) files.
+
*Shapefile limitations mean that field names and values can only be 11 characters long.  This can mean that some node ids and other information is truncated. This is reported in the error reporting.
Shapefile limitations mean that field names and values can only be 11 characters long.  This can mean that some node ids and other information is truncated.
+
<br>
 +
{{Tips Navigation
 +
|uplink=[[Main_Page| Back to Main Page]]
 +
}}

Latest revision as of 01:07, 12 April 2024

Page In Progress

Introduction

This page outlines an approach for conversion of an InfoWorks ICM model to an Estry/TUFLOW format so that the 1D and 2D networks can be replicated in TUFLOW and used to generate a TUFLOW model.

InfoWorks ICM Network Conversion

The InfoWorks data formats are native and therefore do require access to InfoWorks in order to convert the data. Note, that the following steps can be undertaken with a InfoWorks ICM Viewer licence and a full licence is not currently required. Although the InfoWorks ICM data formats are proprietry, it is relatively easy to use the Open Data Export Centre within InfoWorks ICM to export the model geometry data to open GIS layer formats (both shapefile and MIF/MID format). The following steps will outline exporting to shapefiles but similar can be undertaken for MIF/MID. To open the Open Data Export Centre in InfoWorks ICM, open your network in the geoplan, select the relevant scenario, and go to Network->Export->Using Open Data Export Centre. You’ll be presented with the following dialog which allows you to export the InfoWorks network data to a variety of formats.

ODEC.png

The data in InfoWorks ICM is stored in a number of database tables for each network type (eg, a separate table for nodes, conduits, 2D zones etc…).

Quick Export of Geometry Data

To get a full export of all the model files, with InfoWorks file formats, open the network and go to Network->Export->to Shape Files, select the save location and the InfoWorks tables that you're interested in. Once exported the shape files can be opened in GIS to view the network table geometry and parameters. Once the data is exported, it's possible to sue the QGIS TUFLOW Plugin 'Insert TUFLOW Attributes to Existing GIS Layer' and then map across the field values from InfoWorks to TUFLOW with conversion as required.

A Ruby script is also available which will export export all data via the Open Data Export Centre without the need for the user to export each table individually. The data can use a config file to undertake some of the mapping of field values and some conversion.

Use of Ruby Scripts

It’s possible to utilise the Ruby Scripting interface within InfoWorks ICM to speed up the export. A ruby script can be run to call the Open Data Export Centre, and export all requested tables, using a specified config file automatically, significantly reducing the number of button clicks. An example Ruby Script is available from TUFLOW Gitlab User Group which exports all tables and data in an InfoWorks format.

To run the script, you’ll again need to run InfoWorks ICM with a viewer licence or greater. With the desired network in the geoplan, go to Network->Run Ruby Script. Navigate to and select the ruby script, in the below this is ICM_Out_to_shp_1.rb.

Ruby.png

The script will then begin running and prompt the user to select a config file. Navigate and select the relevant config file.

Config.png

The user will then be prompted where they would like to export the data too. Select an appropriate file directory. The ruby script will then cycle through the list of tables within the script and export the tables automatically. Once complete the script will return a log highlighting the location of the exported files. All network objects are exported regardless of system type. System type is exported as an additional field in the shape files to enable filtering within GIS as required.

Ruby log message.png

The exported shape files can then be opened in GIS for further inspection and once checked can be linked together using the various TUFLOW control files. A set of generic control files for this are in progress.

InfoWorks ICM Network
ICM network.png

TUFLOW Network
TUFLOW network.png

Exporting Real Time Control

Operational Control is referred to as Real Time Control (RTC) in InfoWorks. The ruby script above will export the RTC as a text file called [Network_Name]_ICM_RTC.txt which can be used as the basis to generate the TUFLOW Operational Control file. The RTC is made up of the object that is being controlled, the defined ranges in which the structure operates and the desired operation. For example in the below example, the sluice gate, Storm1_Chamber.1, will be set to an 'On' position of 0.2m if the height above datum at FORAST_CSO is below 32.3m AD and will be set to an 'Off' position of 0m if the water level is above 32.3m AD.

RTC.PNG

This can be written using TUFLOW Operation Control rules as the following:-

Define Sluice  == Storm1_Chamber.1
WSE == H1D FORAST_CSO
IF WSE < 32.3
  Gate Opening == 0.2
ELSE
  Gate Opening == 0
END IF

Exporting Boundary Conditions

Inflow, level and rainfall boundaries are all held in separate database objects within InfoWorks. These can be exported directly to .csv file format which can then be modified to put it into a TUFLOW format and a bc_dbase file generated to relate the time-varying data to the relevant model node.

InfoWorks ICM Rainfall Time-Varying Data
ICM Boundary data.png

TUFLOW Rainfall Boundary Time-Varying Data
TUFLOW Boundary data.png

Exporting a Gridded Ground model

Within InfoWorks, select the gridded ground model, right click and choose Export->to ESRI ASCII grid files. This will export into a file format that can be directly used within TUFLOW.

Other Considerations

  • Shapefile limitations mean that field names and values can only be 11 characters long. This can mean that some node ids and other information is truncated. This is reported in the error reporting.


Up
Go-up.png Back to Main Page