TerraHidro Wiki Page

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
start [2023/05/26 13:26]
189.18.138.211 [All functionalities]
start [2024/01/01 22:44] (current)
alexandre [Download]
Line 2: Line 2:
 ===== Download ===== ===== Download =====
  
-  * Last stable release ​(10/​05/​2023):\\+  * Last stable release:\\
  
-- Windows: [[http://​www.dpi.inpe.br/​terrahidro/​download/​TerraHidro-5.2.0.exe|TerraHidro-5.2.0.exe]]\\ +- Windows ​(01/​01/​2024): [[http://​www.dpi.inpe.br/​terrahidro/​download/​TerraHidro-5.2.0.exe|TerraHidro-5.2.0.exe]]\\ 
-- Linux: [[http://​www.dpi.inpe.br/​terrahidro/​download/​terrahidro-5.2.0.tar.gz|terrahidro-5.2.0.tar.gz]]+- Linux (10/​05/​2023): [[http://​www.dpi.inpe.br/​terrahidro/​download/​terrahidro-5.2.0.tar.gz|terrahidro-5.2.0.tar.gz]]
  
 Add the path to the TerraHidro directory into the PATH variable. After this step, the TerraHidro system can be executed by typing **th** in a terminal.\\ Add the path to the TerraHidro directory into the PATH variable. After this step, the TerraHidro system can be executed by typing **th** in a terminal.\\
Line 62: Line 62:
 <​code>​ <​code>​
 C:​\data>​th minibasins tocantinsD8.tif tocantinsSegments.tif tocantinsMinibasins.tif C:​\data>​th minibasins tocantinsD8.tif tocantinsSegments.tif tocantinsMinibasins.tif
 +</​code>​
 +
 +Additional steps can be executed to produce high-quality vector data. The vectorized drainage network generated with the **d8drainagev** functionality simply joins all the drainage network cells that are connected by the D8 flow directions. This procedure generates a vectorized drainage network that contains lines in a raster pattern, which can be improved with some tools from QGIS that smooth the lines for more natural drainage flows. Besides the drainage network, the minibasins raster can be also vectorized, and each polygon smoothed in order to improve the limits of the minibasins.
 +
 +The next commands use the tools available in QGIS 3.22.9 under Windows, where the directory //​C:​\Program Files\QGIS 3.22.9\apps\Python39\Scripts//​ contains the scripts **gdal_sieve.bat** and **gdal_polygonize.bat**,​ and the directory //​C:​\Program Files\QGIS 3.22.9\bin//​ contains the script **grass78.bat**. Both directories were added to the PATH environment variable before executing the scripts. In addition, the scripts **generalize_line.bat** ([[http://​www.dpi.inpe.br/​terrahidro/​download/​generalize_line.bat|generalize_line.bat]]) and **generalize_polygon.bat** ([[http://​www.dpi.inpe.br/​terrahidro/​download/​generalize_polygon.bat|generalize_polygon.bat]]) set the method and the parameters for smoothing the lines and polygons, respectively,​ writing the vector files tocantinsDrainageSmooth.gpkg and tocantinsMinibasinsSmooth.gpkg as output (if necessary, the correct path to the data and file names must be changed inside the scripts).
 +<​code>​
 +C:​\data>​grass78.bat --tmp-location tocantinsDrainage.shp --exec generalize_line.bat
 +C:​\data>​gdal_sieve.bat -st 3 tocantinsMinibasins.tif tocantinsMinibasins3.tif
 +C:​\data>​gdal_polygonize.bat tocantinsMinibasins3.tif -f GPKG tocantinsMinibasins.gpkg
 +C:​\data>​grass78.bat --tmp-location tocantinsMinibasins.gpkg --exec generalize_polygon.bat
 </​code>​ </​code>​
 ===== Example 2: improvements to match a reference drainage network ===== ===== Example 2: improvements to match a reference drainage network =====
Line 412: Line 422:
   * inputDrainage.tif - input drainage network (raster).   * inputDrainage.tif - input drainage network (raster).
   * inputAccumulatedArea.tif - input D8 contributing area (raster).   * inputAccumulatedArea.tif - input D8 contributing area (raster).
-  * putMouth.txt - input mouth (grid coordinates) (text file).+  * inputMouth.txt - input mouth (grid coordinates) (text file).
   * outputRiver.tif - output main river of the drainage network traced upstream from the mouth according to the largest contributing areas (raster).   * outputRiver.tif - output main river of the drainage network traced upstream from the mouth according to the largest contributing areas (raster).
 **shreve** - Generates the Shreve stream order from an D8 flow directions grid, a drainage grid, and a sources text file. **shreve** - Generates the Shreve stream order from an D8 flow directions grid, a drainage grid, and a sources text file.
Line 418: Line 428:
 th shreve inputD8.tif inputDrainage.tif inputSources.txt outputShreve.tif th shreve inputD8.tif inputDrainage.tif inputSources.txt outputShreve.tif
 </​code>​ </​code>​
 +  * inputD8.tif - input D8 flow directions (raster).
 +  * inputDrainage.tif - input drainage network (raster).
 +  * inputSources.txt - input sources (grid coordinates) of the drainage network (text file).
 +  * outputShreve.tif - output Shreve order encoding of the drainage segments (raster).
 **strahler** - Generates the Strahler stream order from an D8 flow directions grid, a drainage grid, and a sources text file. **strahler** - Generates the Strahler stream order from an D8 flow directions grid, a drainage grid, and a sources text file.
 <​code>​ <​code>​
 th strahler inputD8.tif inputDrainage.tif inputSources.txt outputStrahler.tif th strahler inputD8.tif inputDrainage.tif inputSources.txt outputStrahler.tif
 </​code>​ </​code>​
 +  * inputD8.tif - input D8 flow directions (raster).
 +  * inputDrainage.tif - input drainage network (raster).
 +  * inputSources.txt - input sources (grid coordinates) of the drainage network (text file).
 +  * outputStrahler.tif - output Strahler order encoding of the drainage segments (raster).
 ===== TerraHidro Plugin for QGIS Processing Toolbox ===== ===== TerraHidro Plugin for QGIS Processing Toolbox =====
  

QR Code
QR Code start (generated for current page)