GRID to GRID draft: Difference between revisions

Content deleted Content added
No edit summary
Line 43:
*Converts the file "DEM.asc" to.flt format.<br>
:<tt>grid_to_grid.exe -conv -flt DEM.asc</tt>
* Converts an ASCasc grid to a GeoTIFF with an LZW compression and horizontal predictor, see <u>[[#Creation_Options | Creation Options]]</u>.<br>
:<tt>grid_to_grid.exe -conv -tif DEM_M01.asc -co COMPRESS=LZW -co PREDICTOR=2</tt>
* Converts GeoTIFF to a Cloud Optimised GeoTIFF. Requires <tt>-out</tt> flag since the extension for COG is also .tif and the default output file would be the same as the input file.<br>
Line 55:
Examples:<br>
*Creates a new grid containing the maximum of the 3 input water level grids.<br>
:<tt>grid_to_grid.exe -max Q100_30min_h.tif Q100_45min_h.asctif Q100_60min_h.asctif</tt><br>
*As per item 2 above, but specifies the output name "Q100_Max_Levels.asctif".<br>
:<tt>grid_to_grid.exe -out Q100_Max_Levels.asctif -max Q100_30min_h.asctif Q100_45min_h.asctif Q100_60min_h.asctif</tt><br>
*Wildcard character "*" is supported in filenames.<br>
:<tt>grid_to_grid.exe -out Q100_Max_Levels.asctif -max Q100_*min_h.asctif</tt>
* Runs a maximum operation on all FLT grids in a given location and outputs to a GeoPackage raster.<br>
:<tt>grid_to_grid.exe -max -out "output_grids.gpkg >> maximum_h" *.flt</tt>
Line 70:
*A second grid with a “_wd” suffix is output to indicate which .asc grid cells were once wet and are now dry (value -99) or once dry and are now wet (value +99 with first .asc to be the developed case and second .asc to be the existing case). Importing this grid into Vertical Mapper creates a .grc (grid classification) grid that has two categories: “Was Wet Now Dry” and “Was Dry Now Wet”. This grid is particularly useful for displaying areas that were previously inundated or previously flood-free.<br>
Example:
*Creates new grids comparing the differences in flood levels and extents for: "difference.asctif" = "after_h.asctif" - "before_h.asctif"<br>
:<tt>grid_to_grid.exe -out difference.asctif -dif after_h.asctif before_h.asctif</tt>
*Runs a difference operation on GeoTIFF outputs.<br>
:<tt>grid_to_grid.exe -dif proposed.tif existing.tif</tt>
Line 91:
Examples:
*Creates a new depth grid only where the depth is greater than 0.1m.<br>
:<tt>grid_to_grid.exe -cd0.1 depth.asctif</tt>
*Creates a new level grid only where the depth is greater than 0.1m.<br>
:<tt>grid_to_grid.exe -cd0.1 depth.asctif levels.asctif</tt>
*As per the example above, but sets the output name as "filtered_levels.asctif".<br>
:<tt>grid_to_grid.exe -cd0.1 -out filtered_levels.asctif depths.asctif levels.asctif</tt>
 
==Resize==
Line 103:
This is the defualt processing method, which can also be specified with the '''-rm_avg''' (resize method - average) input flag. When processing for each tile in the new grid, the average of all non-null values in the input grid is taken. For example with a resize factor of 5, the 25 values in the input grid are averaged.<br>
Example:
*Creates a new 10m DEM (DEM_10m.asc) based on the the 2m DEM using an averaging approach.<br>
:<tt>grid_to_grid.exe -resize5 -out DEM_10m.asctif DEM_2m.asctif</tt>
 
===Minimum===
Alternative processing method for resize, specified with the '''-rm_min''' (resize method - minimum) flag. At each output grid the values is the minimum of the values in the input grid.<br>
Example:
*Creates a new 10m DEM (DEM_10m_min.asc) based on the the 2m DEM using an minimum approach.<br>
:<tt>grid_to_grid.exe -resize5 -rm_min -out DEM_10m_min.asctif DEM_2m.asctif</tt>
 
===Maximum===
Alternative processing method for resize, specified with the '''-rm_max''' (resize method - maximum) flag. At each output grid the values is the maximum of the values in the input grid.<br>
Example:
*Creates a new 10m DEM (DEM_10m_max.asc) based on the the 2m DEM using an maximum approach.<br>
:<tt>grid_to_grid.exe -resize5 -rm_max -out DEM_10m_max.asctif DEM_2m.asctif</tt>
 
==Transform==
Line 122:
Examples:
*Multiplies all values by 0.3048.<br>
:<tt>grid_to_grid.exe -trans_m0.3048 DEM.asctif</tt>
*Multiplies all values by 0.3048 and then adds 10.0.<br>
:<tt>grid_to_grid.exe -trans_m0.3048 -trans_c10 DEM.asctif</tt>
 
==Decimal==
Converts .flt to .asc formatgrids with specified number of decimal spaces. ASCFor example asc format created directly from TUFLOW comes only with three decimal spaces, FLTflt and tif format has more decimal spaces.<br>
Example:
*Converts all .flttif grids to .asc format with 5 decimal spaces.<br>
:<tt>grid_to_grid.exe -conv -asc -decimal5 *.flttif</tt>
 
==Classify==
Classifies the grid based on the input classifications. The output file is a classified .asc grid. The classification .csv file should have two columns cutoff value and name (in that order). The first line in .csv treated as a header line and ignored. Any values over the greatest cutoff with be outputted to class "above".<br>
{| class="wikitable"
 
Line 148:
Examples:
*Outputs a classified grid, based on the cut off values and names in the "classifications.csv".<br>
:<tt>grid_to_grid.exe -classify classifications.csv results_VMax.asctif</tt>
*If using vertical mapper the -grc option can be used to create the .asctif file in classified grid format, in this format rather than storing a numerical value when interrogating an area a label is returned. This format is not recognised by ArcMap or QGIS. If using the grc option it is also possible to specify the desired RGB (red, green, blue) values for the output grid in the .csv file used for the classification. The RGB values should be specified in the 3-5th columns of the .csv file.<br>
:<tt>grid_to_grid.exe -RGB -grc -classify depth_classify.csv results_dMax.asctif</tt><br>
 
:{| class="wikitable"
Line 183:
'''NOTE:''' For the output GIS file, the '''dz''' attribute is set to 0.0 regardless of the value set in the input field. <br>
Example:
*<tt>grid_to_grid.exe -brkline 2d_zsh_breaklines_L.shp DEM.ascflt</tt>
*<tt>grid_to_grid.exe -brkline 2d_zsh_breaklines_L.gpkg DEM.tif</tt>
 
Line 242:
|Above 5.0|| Above 5.0 || 973 || 0.06
|}
*Example usage:
:<tt>grid_to_grid.exe –histogram histogram_bins.csv results_d_Max.asctif</tt>
 
==Extract 1D Model Inputs==
Line 365:
==Calibration Points==
'''"-cp <cp_file>"'''<br>
For appending the value from a .asc or .fltgrid file to a .mif or .shp file. The cp_file contains points representing locations where results are extracted from TUFLOW. The file format includes two attributes. The first attribute is a numeric field containing the recorded value. The second field is a char(100) text field containing the cp name.<br>
'''"-config <config_file>"''' (optional)<br>
Points to a csv file containing accuracy thresholds and style control options, e.g. symbol, colour and size.<br>
Line 373:
The second search radius used to search for maximum and minimum values in meters.<br>
Example usage:
*<tt>grid_to_grid.exe -cp Flood_Marks.MIF -config diff_config.csv -cpsd100 -cpmm50 results_h_Max.asctif</tt><br>
 
==Statistics==
<big>'''"-stat<type>"'''</big>
As of the 2017-10-AA build, the grid_to_grid.exe utility allows the user to perform a number of statistical analyses on a group of input grids (*.flt or *.asc format). This is particularly useful when extracting information from assessments that produce multiple result files for a single event, for example, processing grids from an ensemble assessment with numerous temporal pattern arrangements.
 
The available options are:
Line 397:
* An SRC grid: a grid listing which source input grid the median result value came from (a corresponding .csv file is also written as a legend)<br>
Example usage:
*<tt>grid_to_grid.exe -statMedian Q100_30min_TP1_h.asctif Q100_30min_TP2_h.asctif Q100_30min_TP3_h.asctif Q100_30min_TP4_h.asctif Q100_30min_TP5_h.asctif </tt><br>
 
[[File: asc_to_asc_statsMedian_eg.PNG|1000px|]]<br>
Line 411:
* An SRC grid: a grid listing which source input grid the result value came from or was the next above (a corresponding .csv file is also written as a legend)<br>
Example usage:
*<tt>grid_to_grid.exe -statMean Q100_30min_*_h.asctif</tt><br>
 
==="-statFrac"===
Line 419:
* A Frac grid: the resulting Fraction value<br>
Example usage:
*<tt>grid_to_grid.exe -statFrac Q100_30min_*_h.asctif</tt><br>
 
==="-statMin"===
Line 428:
* An SRC grid: a grid listing which source input grid the minimum result value came from (a corresponding .csv file is also written as a legend)<br>
Example usage:
*<tt>grid_to_grid.exe -statMin Q100_30min_*_h.asctif</tt><br>
 
==="-statMax"===
Line 437:
* An SRC grid: a grid listing which source input grid the maximum result value came from (a corresponding .csv file is also written as a legend)<br>
Example usage:
*<tt>grid_to_grid.exe -statMax Q100_30min_*_h.asctif</tt><br>
 
==="-statAll"===
Line 447:
* A .csv file that contains the legend for all SRC grids<br>
Example usage:
*<tt>grid_to_grid.exe -statAll Q100_30min_*_h.asctif</tt><br>
 
==="-statRank<integer id>"===
Line 456:
* An SRC grid: a grid listing which source input grid the ranked result value came from (a corresponding .csv file is also written as a legend)<br>
Example usage:
*<tt>grid_to_grid.exe -statRank5 Q100_30min_*_h.asctif</tt><br>
 
==Flood Extent==
Returns a simple grid with value of 1 where the input grid has an active, non-zero value.<br>
Example usage:
*<tt>grid_to_grid.exe -fe results_dMax.asctif</tt><br>
 
==Remap==
Line 472:
Examples:
*The utility can also remap additional map output grids (e.g. velocity, hazard and others) to the resolution of the DEM file, e.g.<br>
:<tt>grid_to_grid.exe -remap -wl lowres_h.asctif -dem DEM_highres.asctif</tt>
*The utility can also apply a buffer distance or add freeboard. For example, the below applies a buffer distance of 20m, and adds a freeboard of 0.2m to the original water level grid.<br>
:<tt>grid_to_grid.exe -remap -wl lowres_h.asctif -dem DEM_highres.asctif lowres_v.asctif lowres_hazard.asctif</tt>
:<tt>grid_to_grid.exe -remap -fb0.2 -bd20 -wl lowres_h.asctif -dem DEM_highres.asctif</tt>
 
Note that, for any output types other than depth, this utility does NOT interpolate the result from the coarser grid to the finer grid, but only extends/reduces the output extent to the dry/wet extent. More discussions on this function is documented here [[TUFLOW_Remapping | TUFLOW Remapping Tool]].<br>