GRID to GRID draft: Difference between revisions

Content deleted Content added
No edit summary
Line 26:
|}
 
=GPKG and NetCDF=
GeoPackage and NetCDF are database formats and are able to contain multiple layers in a single file. When passing in an input or output reference to a GeoPackage or NetCDF file the layer name is assumed to be the same as the database name unless otherwise specified. To give the layer a different name than the database, the following syntax <tt>"database.ext >> layer"</tt> can be used:<Br>
<pre>grid_to_grid.exe -dif "database.gpkg >> raster1" "database.gpkg >> raster2"</pre>
Notes:
* Quotes will always be required when using this syntax.
* GPKG output paths can be either a new or existing database i.e. the utility supports writing new layers into an existing database.
* NetCDF outputs will overwrite any existing NetCDF file.
* Typically outputs to the GPKG or NetCDF format will be grouped together into a single output file.
 
=CreationOther Options (switches)=
A list of the general switches is provided in the table below, these are available for all operations listed above:<br>
The grid_to_grid.exe supports GDAL style creation options. Creation options can be passed in using the -co flag then the name of the creation option and the value:<Br>
{| align="center" class="wikitable"
<pre>-co COMPRESS=DEFLATE</pre>
Multiple creation options can be used (each will require its own -co flag).<Br>
<Br>
The creation options have adopted the same naming as GDAL (more information on the options can be found at <b><u>[https://gdal.org https://gdal.org]</u></b>), however, not all options in GDAL are supported in the grid_to_grid.exe utility. The following creation options are supported:<Br>
====GeoTIFF====
* COMPRESS=NONE/DEFLATE/LZW - output compression. Default - DEFLATE.
* ZLEVEL=[0-9] - Compression level. Zero is no compression, 9 is hightest compression. Only supported for DEFLATE compression method. Default - 9.
* PREDICTOR=1/2 - Compression predictor. Supported options are none [1] and horizontal differencing [2]. Default - 2.
* NUM_THREADS=[N]/ALL_CPUS - Number of threads to use when processing GeoTIFFs. Default - ALL_CPUS.
* BIGTIFF=YES/NO/IF_NEEDED - Controls whether the ouput file uses the BigTIFF format or classic TIFF. Default - IF_NEEDED.
* TILED=YES/NO - Controls whether the output GeoTIFF should use tiles or strips. Default - NO.
* OVERVIEWS=YES/NO - Controls whether overviews (also known as pyramids) should be created. The grid_to_grid tool only supports internal overviews and therefore this option is only supported for tiled GeoTIFFs. Default - NO.
 
! style="background-color:#005581; font-weight:bold; color:white;"| Switch
====Cloud Optimised GeoTIFF (COG)====
! style="background-color:#005581; font-weight:bold; color:white;" width=80% | Description
Same options as GeoTIFF however will automatically use 'TILED=YES' and 'OVERVIEWS=YES' creation options.
|-
 
|"-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. The -b flag should be placed after the grid_to_grid.exe call, before the function command. For example:<br> <tt>grid_to_grid.exe -b -brkline 2d_zsh_breaklines_L.shp DEM.asc</tt><br>
====GeoPackage====
|-
* COMPRESS=NONE/LZW - output compression. Default - LZW
|"-out <output grid name>"||Specify the output filename for the new grid. <br> '''Note:''' a space is required between the -out and the filename.
* PREDICTOR=1/2 - Compression predictor. Supported options are none [1] and horizontal differencing [2]. Default - 2.
|-
* OVERVIEWS=YES/NO - Controls whether overviews (also known as pyramids) should be created. Default - NO.
|"-flt"||Set the output grid format to binary float (.flt).
 
|-
====NetCDF====
|"-asc"||Set the output grid format to ESRI ascii format (.asc).
* COMPRESS=NONE/DEFLATE- output compression. Default - DEFLATE
|-
* ZLEVEL=[0-9] - Compression level. Zero is no compression, 9 is hightest compression. Only supported for DEFLATE compression method. Default - 9.
|"-grc"||For use with the "-classify" option and .asc format output. This creates a classified grid (uses name rather than number). This is only valid if using Vertical Mapper, neither QGIS or ArcMap will recognise this format. This can also be used with the -RGB option to specify the output colouring of your grid.
 
|-
====ASC====
|"-check"||This creates check files for the data processing if applicable.
* DECIMAL_PRECISION=N - The number of decimal places in the output. This option is analogous to the <tt>"-decimal[N]"</tt> switch. Default - 3.
|-
|"-src"||For use with -min,-max or various stat options to supress the source grid output. Will only output the minimum, maximum, mean, median, frac grid. The src_legend.csv is also supressed.
|}
<br>
 
=Operations=
Line 510 ⟶ 495:
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>
 
=Other Options (switches)=
A list of the general switches is provided in the table below, these are available for all operations listed above:<br>
{| align="center" class="wikitable"
 
=GPKG and NetCDF=
! style="background-color:#005581; font-weight:bold; color:white;"| Switch
GeoPackage and NetCDF are database formats and are able to contain multiple layers in a single file. When passing in an input or output reference to a GeoPackage or NetCDF file the layer name is assumed to be the same as the database name unless otherwise specified. To give the layer a different name than the database, the following syntax <tt>"database.ext >> layer"</tt> can be used:<Br>
! style="background-color:#005581; font-weight:bold; color:white;" width=80% | Description
<pre>grid_to_grid.exe -dif "database.gpkg >> raster1" "database.gpkg >> raster2"</pre>
|-
Notes:
|"-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. The -b flag should be placed after the grid_to_grid.exe call, before the function command. For example:<br> <tt>grid_to_grid.exe -b -brkline 2d_zsh_breaklines_L.shp DEM.asc</tt><br>
* Quotes will always be required when using this syntax.
|-
* GPKG output paths can be either a new or existing database i.e. the utility supports writing new layers into an existing database.
|"-out <output grid name>"||Specify the output filename for the new grid. <br> '''Note:''' a space is required between the -out and the filename.
* NetCDF outputs will overwrite any existing NetCDF file.
|-
* Typically outputs to the GPKG or NetCDF format will be grouped together into a single output file.
|"-flt"||Set the output grid format to binary float (.flt).
 
|-
=Creation Options=
|"-asc"||Set the output grid format to ESRI ascii format (.asc).
The grid_to_grid.exe supports GDAL style creation options. Creation options can be passed in using the -co flag then the name of the creation option and the value:<Br>
|-
<pre>-co COMPRESS=DEFLATE</pre>
|"-grc"||For use with the "-classify" option and .asc format output. This creates a classified grid (uses name rather than number). This is only valid if using Vertical Mapper, neither QGIS or ArcMap will recognise this format. This can also be used with the -RGB option to specify the output colouring of your grid.
Multiple creation options can be used (each will require its own -co flag).<Br>
|-
<Br>
|"-check"||This creates check files for the data processing if applicable.
The creation options have adopted the same naming as GDAL (more information on the options can be found at <b><u>[https://gdal.org https://gdal.org]</u></b>), however, not all options in GDAL are supported in the grid_to_grid.exe utility. The following creation options are supported:<Br>
|-
====GeoTIFF====
|"-src"||For use with -min,-max or various stat options to supress the source grid output. Will only output the minimum, maximum, mean, median, frac grid. The src_legend.csv is also supressed.
* COMPRESS=NONE/DEFLATE/LZW - output compression. Default - DEFLATE.
|}
* ZLEVEL=[0-9] - Compression level. Zero is no compression, 9 is hightest compression. Only supported for DEFLATE compression method. Default - 9.
* PREDICTOR=1/2 - Compression predictor. Supported options are none [1] and horizontal differencing [2]. Default - 2.
* NUM_THREADS=[N]/ALL_CPUS - Number of threads to use when processing GeoTIFFs. Default - ALL_CPUS.
* BIGTIFF=YES/NO/IF_NEEDED - Controls whether the ouput file uses the BigTIFF format or classic TIFF. Default - IF_NEEDED.
* TILED=YES/NO - Controls whether the output GeoTIFF should use tiles or strips. Default - NO.
* OVERVIEWS=YES/NO - Controls whether overviews (also known as pyramids) should be created. The grid_to_grid tool only supports internal overviews and therefore this option is only supported for tiled GeoTIFFs. Default - NO.
====Cloud Optimised GeoTIFF (COG)====
Same options as GeoTIFF however will automatically use 'TILED=YES' and 'OVERVIEWS=YES' creation options.
====GeoPackage====
* COMPRESS=NONE/LZW - output compression. Default - LZW
* PREDICTOR=1/2 - Compression predictor. Supported options are none [1] and horizontal differencing [2]. Default - 2.
* OVERVIEWS=YES/NO - Controls whether overviews (also known as pyramids) should be created. Default - NO.
====NetCDF====
* COMPRESS=NONE/DEFLATE- output compression. Default - DEFLATE
* ZLEVEL=[0-9] - Compression level. Zero is no compression, 9 is hightest compression. Only supported for DEFLATE compression method. Default - 9.
====ASC====
* DECIMAL_PRECISION=N - The number of decimal places in the output. This option is analogous to the <tt>"-decimal[N]"</tt> switch. Default - 3.
<br>
<br>