TUFLOW to GIS

From TUFLOW FV Wiki
Revision as of 14:31, 28 March 2023 by Georgia.stones (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
USEFUL LINKS
Wiki Links Help Downloads
TUFLOW FV Wiki Main Page Products Support/Contact TUFLOW FV Downloads
TUFLOW FV Tutorials Requesting a Licence Tutorial Module Data
TUFLOW Classic/HPC Wiki TUFLOW FV Glossary Manuals

Running TUFLOW_to_GIS

The TUFLOW_to_GIS.exe is a utility available on the the TUFLOW website (Download TUFLOW FV utilities).

Simply double clicking on the TUFLOW_to_GIS executable will bring up a DOS prompt that that gives you some instructions on running the utility. The most common way to run the utility is from a batchfile. This allows the user to process multiple outputs at once. A batch file is simply a plain text file containing one or more lines that execute a utility as per the example sections below.

Output

Gridded (raster) data is outputted in the ESRI ASCII grid format. This is plain text format and is very widely recognised and used by a variety of GIS software including ArcGIS (requires Spatial Analyst), QGIS, SAGA and MapInfo (requires Vertical Mapper or Encom Discover). This is specified with the flag -asc.

Vector outputs (e.g. velocity or flow) can be written as either points or arrows. Scalar outputs (e.g. depth or level) can be written as points. These can currently be written out in either MapInfo format (.mif) or ArcGIS shapefiles (.shp). The -mif flag is used to output in MapInfo format and -shp to output in shapefile format. Only one type (-mif or -shp) can be processed at a time, to output in both formats, use two entries in a batchfile.

Input Flags (switches)

A list of the most common switches is outlined below:

Switch Description
"-b" Run the utility in batch mode, this suppresses the prompt to press enter at the end of processing. Used in .bat files where two or more files are to be processed.
"-asc" The output file will be in ESRI ASCII Grid format, a text format recognised by most 3D grid modelling software (including Vertical Mapper, SAGA and QGIS)
"-mif" The output format will be the MapInfo Interchange format (.mif/.mid) recognised by most GIS software
"-shp" The output format will be the ArcGIS Shapefile format. This can be opened directly in ArcMap, QGIS or SAGA (and most GIS software)
"-vector" or "-arrows" The output will contain arrows as polygons to display vector data (eg. velocities and unit flows) in GIS. Must be used with the -mif option.
"-t<output time>" Converts the data at the specified timestep, for example -t2 to convert output time 2 hours. If this switch is omitted the utility will display a list of available times and prompt for an input. Use -t99999 or -max to convert the maximums.
"-max" or "-t99999" This switch is presently not supported for TUFLOW FV output
"-sf<scale factor>" Scale factor to scale the size of the arrows. The default is sf = 1, which means either:
  • if grid is not specified the cell size of the first 2D domain in the .tcf file is equivalent in length to an arrow of 1m/s for _V.dat files or 1m2/s for _q.dat files.
  • if grid is specified, the grid <dist> value is used instead of the cell size of the first 2D domain to scale the arrows.
    For example, if the first 2D domain has a cell size of 10m, by default, a 1m/s velocity arrow will be 10m long. If sf0.5 or grid5, is specified the 1m/s velocity arrow will be 5m long.
"-2dm <.2dm file>" To explicitly specify a .2dm file. By default TUFLOW_to_GIS assumes the .2dm file has the same name as the .dat file. Must be a space between -2dm and “<2dm_file>”.
"-grid<dist>" The output will be on a regular north-south aligned grid of spacing <dist> metres. If no <dist> is specified the user is prompted to enter a distance (e.g. "-grid"). If no grid input is used with a -mif or -shp conversion the data is converted at the cell corners. For a "-asc" output if no grid input is specified the default is 1/2 of the 2D cell size.

For -asc output it sets the raster cell size of the 3D ESRI ASCII grid.
For -mif or -shp output sets the interval in metres for the output on a north-south alignment.

"-type<output type>" This switch is presently not supported for TUFLOW FV output

Examples

    Converting to grids

    Probably the most common use of the TUFLOW_to_GIS utility is to convert the model results to a 3D surface. A number of examples are given below:

    • Convert to a 3D grid of specified grid cell size at a specific time:
  1. TUFLOW_to_GIS.exe -asc -b -grid2 -t2 -2dm Tute.2dm M01_5m_003_h.dat
  2. Description: Convert to a grid asc ("-asc"), using batch mode ("-b"), at a 2m grid resolution ("-grid2"), at time of 2 hours ("-t2"), 2dm file = Tute.2dm ("-2dm"), result file = M01_5m_003_h.dat.
    • Extract maximum water level results and convert to a 3D grid of specified grid cell size:
  3. RES_to_RES.exe -max -b M01_5m_003_h.dat
  4. Description: Using RES_to_RES to extracting maximum water level results from all output timesteps ("-max"), using batch mode ("-b").
    TUFLOW_to_GIS.exe -2dm Tute.2dm -asc -b -grid2 -t111111 -2dm Tute.2dm M01_5m_003_h(maxmax).dat
    Description: Maximum water level results to grid asc ("-asc"), using batch mode ("-b"), at a 2m grid resolution ("-grid2"), at time the RES_to_RES maximum output time of 111111 hours ("-t111111"), 2dm file = Tute.2dm ("-2dm"), result file = M01_5m_003_h(maxmax).dat.

    Converting to Points

    To output to a points file specify either a MapInfo output with the "-mif" switch or Arc shapefiles output with the "-shp" output:

    • Convert velocity at time 2 hours to a MapInfo points file using a 2m grid resolution:
  5. TUFLOW_to_GIS.exe -mif -b -t2 -grid2 M01_5m_003_v.dat
  6. Description: Convert to a MapInfo mif format ("-mif"), using batch mode ("-b"), at time of 2 hours ("-t2"), 2m grid resolution ("-grid2") for the results file M01_5m_003_v.dat.

    Converting to Arrows

    To output to vectors file specify either a MapInfo "-mif" or Arc shapefiles ("-shp") output type and the "-vector" option. This will create a vector dataset, with the vectors stored as polygon objects.
    The size of the vectors can be controlled with the scale factor ("-sf") switch. NOTE: The input .dat file or dataset type must be a vector dataset, such as velocity or unit flow.

    • Convert output time 2 to a MapInfo vector file at cell corners using a 2m grid resolution:
  7. TUFLOW_to_GIS.exe -mif -vector -b -t2 -grid2 M01_5m_003_V.dat
  8. Description: Convert to a MapInfo format ("-mif"), using vector outputs ("-vector"), using batch mode ("-b"), converting at time 2 hours ("-t2"), using 2m grid resolution ("-grid2"), for the velocity results M01_5m_003_V.dat.
    • Convert output time 2 to a MapInfo vector file:
  9. TUFLOW_to_GIS.exe -mif -vector -sf0.5 -b -t2 -grid2 M01_5m_003_V.dat
  10. Description: As above with a scale factor of 0.5, so that the arrows will be half the length.

    Creating a Batchfile

    Create a plain text file listing the series of commands which you would like to execute.

    TUFLOW_to_GIS.exe -asc -b -grid2 -t2 M01_5m_003_h.dat
    TUFLOW_to_GIS.exe -asc -b -grid2 -t2 M02_5m_003_h.dat
    

    Save the file with at .bat extension. Double clicking the file within Windows Explorer will start the batchfile.
    Note: Absolute or relative reference to the TUFLOW_to_GIS.exe and the TUFLOW FV result file (*.dat) from the folder location where the batchfile is saved is required.
    e.g. absolute referencing: D:\TUFLOW_FV\Utilities\TUFLOW_to_GIS.exe e.g. relative referencing: ..\output\M02_5m_003_h.dat