Difference between revisions of "TUFLOW to GIS"
Line 83: | Line 83: | ||
To export either of the above to shapefile format simply replace the "-mif" with "-shp". | To export either of the above to shapefile format simply replace the "-mif" with "-shp". | ||
* Convert velocity at time 2 hours MapInfo points file, where the results file is in xmdf format:<br> | * Convert velocity at time 2 hours MapInfo points file, where the results file is in xmdf format:<br> | ||
− | <li><tt>TUFLOW_to_GIS.exe - | + | <li><tt>TUFLOW_to_GIS.exe -shp -b -t2 -typeV M01_5m_003.xmdf</tt></li> |
− | <u>Description:</u> Convert to a | + | <u>Description:</u> Convert to a ArcGIS shapefile format ("-shp"), using batch mode ("-b"), at time of 2 hours ("-t2"), converting the velocity output ("-typeV") for the results file '''M01_5m_003.xmdf'''.<br> |
== Converting to Arrows == | == Converting to Arrows == | ||
</ol> | </ol> |
Revision as of 11:32, 9 September 2011
Introduction
The TUFLOW_to_GIS.exe is a utility available on the the TUFLOW website (http://www.tuflow.com/Downloads_Utilities.htm Download TUFLOW utilities]).
The utility can be used to convert TUFLOW outputs (.dat and .xmdf) into formats that can be imported into GIS packages such as MapInfo, ArcGIS and SAGA. For more details on the TUFLOW utility please see section 11.2 of the 2010 TUFLOW manual.
Running TUFLOW_to_GIS
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 Options
Gridded Data
The major output options are 3D grid in .asc format, which can be read into ArcGIS (requires Spatial Analyst), SAGA and MapInfo (requires Vertical Mapper or Encom Discover). This is specified with the flag -asc.
Point and Vector Data
Vector outputs can be written as either points or arrows. Scalar output can be written as points. These can currently be written out in 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 input switches is provided in the 2010 TUFLOW manual as Table 11.1. However the most common arguments are:
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 and SAGA) |
"-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 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" | The maximums will be converted. The maximums must have been written to be able to convert using the -max or -t99999 switch. See the .tcf file command (Store Maximums and Minimums == ON MAXIMUMS ONLY). |
"-sf<scale factor>" | Scale factor to scale the size of the arrows. |
"-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 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 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. |
"-type<output type>" | For use with .xmdf inputs, in which all inputs are stored in the one .xmdf file. Use this to convert a specific output type. Output types should as specified per the output type in the .tcf eg. h (water level), V (velocity), q (flow), or d (depth).Scale factor to scale the size of the arrows. |
Examples
- Convert maximums to a 3D grid:
- TUFLOW_to_GIS.exe -asc -b -max M01_5m_003_h.dat Description: Convert to a 3D grid ("-asc"), using batch mode ("-b"), converting the maximums ("-max") for the water level results M01_5m_003_h.dat.
- Convert to a 3D grid at a specific time:
- TUFLOW_to_GIS.exe -asc -b -t3 M01_5m_003_h.dat Description: As per example 1, except conversion at time 3 hours (-t3) instead of the maximums.
- Convert to a 3D grid of specified grid cell size:
- TUFLOW_to_GIS.exe -asc -b -grid1 -max M01_5m_003_h.dat Description: As per example 1, except the raster cell size is specified at 1m instead of being half the 2D cell size.
- Convert to a 3D grid from .xmdf file:
- TUFLOW_to_GIS.exe -asc -b -typeh -max M01_5m_003.xmdf Description: As per example 1, output TUFLOW format is .xmdf. The -typeh specifies the h(water level) output to be converted.
- TUFLOW_to_GIS.exe -asc -b -typeV -max M01_5m_003.xmdf Description: As per example 4, except the the velocity results (-typeV) are processed instead of water level (-typeh).
- Convert maximums to a MapInfo Points file at cell corners:
- TUFLOW_to_GIS.exe -mif -b -max M01_5m_003_h.dat Description: Convert to a MapInfo format ("-mif"), using batch mode ("-b"), converting the maximums ("-max") for the water level results M01_5m_003_h.dat.
- Convert maximums to a MapInfo Points file on a regular grid:
- TUFLOW_to_GIS.exe -mif -grid2 -b -max M01_5m_003_h.dat Description: Convert to a MapInfo format ("-mif") on a regular 2m grid ("-grid2"), using batch mode ("-b"), converting the maximums ("-max") for the water level results M01_5m_003_h.dat.
- Convert velocity at time 2 hours MapInfo points file, where the results file is in xmdf format:
- TUFLOW_to_GIS.exe -shp -b -t2 -typeV M01_5m_003.xmdf Description: Convert to a ArcGIS shapefile format ("-shp"), using batch mode ("-b"), at time of 2 hours ("-t2"), converting the velocity output ("-typeV") for the results file M01_5m_003.xmdf.
Converting to 3D grids
Probably the most common use of the TUFLOW_to_GIS utility is to convert the maximum results to a 3D surface. A number of examples are given below:
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. To output at cell corners only:
To export either of the above to shapefile format simply replace the "-mif" with "-shp".