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 [2016/05/30 19:30]
150.163.2.71 [Donwload]
start [2024/01/01 22:44] (current)
alexandre [Download]
Line 1: Line 1:
 <​html><​h1><​b><​font color="#​007FFF">​TerraHidro 5 - Console applications</​font></​b></​h1></​html>​ <​html><​h1><​b><​font color="#​007FFF">​TerraHidro 5 - Console applications</​font></​b></​h1></​html>​
-===== Donwload ​=====+===== Download ​=====
  
-Last stable release\\ +  * Last stable release:\\
-[[http://​www.dpi.inpe.br/​~alexandre/​terrahidro5/​ThConsole-5.0.1-win64.exe|ThConsole-5.0.1-win64.exe]]+
  
-Most recent version\\ +- Windows (01/​01/​2024):​ [[http://​www.dpi.inpe.br/​terrahidro/​download/​TerraHidro-5.2.0.exe|TerraHidro-5.2.0.exe]]\\ 
-[[http://​www.dpi.inpe.br/​~alexandre/terrahidro5/ThConsole-5.1.0-win64.exe|ThConsole-5.1.0-win64.exe]]+- Linux (10/​05/​2023): ​[[http://​www.dpi.inpe.br/​terrahidro/download/terrahidro-5.2.0.tar.gz|terrahidro-5.2.0.tar.gz]]
  
-==== Change Log ==== +Add the path to the TerraHidro directory into the PATH variableAfter this step, the TerraHidro system can be executed by typing **th** in a terminal.\\
-=== 5.0.1 ===+
  
-  * Fixed the bug that generates ​blank drainage raster.+- Windows: Settings, type Edit System Variables, System Variables, select Path, Edit, New, copy path to the TerraHidro directory (e.g. //​C:​\TerraHidro-5.2.0//​).\\ 
 +- Linux: extract the file terrahidro-5.2.0.tar.gz using "//tar -zxvf terrahidro-5.2.0.tar.gz//"​ under /home/user, where //user// is the username; open terminal, export PATH=/​home/​user/​terrahidro-5.2.0/​bin:​$PATH,​ export TERRALIB_HOME=/​home/​user/​terrahidro-5.2.0,​ export LD_LIBRARY_PATH=/​home/​user/​terrahidro-5.2.0/​lib:​$LD_LIBRARY_PATH. In order to permanently set the variables PATH, TERRALIB_HOME,​ and LD_LIBRARY_PATH,​ these variables must be modified in the resources file under the /home/user directory (e.g. .bashrc).
  
-===== Simple Example =====+Note: The Linux version was compiled on a Fedora Core 36 that had all the necessary packages installed. The Terralib library has many dependencies,​ which must be solved to avoid any problems. The main packages (version) used for the compilation were: gcc/stdc++ (12.2.1), glibc (2.35), qt5 (5.15.8), boost (1.76), proj (8.2.1), geos (3.10.2), gdal (3.4.3), sqlite (3.36), tiff (4.4), geotiff (1.7.1), X11 (1.7.3). Please, solve any dependencies before executing TerraHidro on Linux.
  
 +  * Input data for examples (lower Tocantins region known as Acará-Guamá):​\\
  
-Imagine that you have the DEM of Amazon basin on the file "C:\data\amazon_dem.tif".\\ +Tocantins ​DEM: [[http://​www.dpi.inpe.br/​terrahidro/​download/​tocantins/​tocantinsDEM.tif|tocantinsDEM.tif]]\\ 
-And you want to extract the drainage ​network using the TerraHidro 5 console applications.\\+Tocantins drainage (Shapefile):​ [[http://​www.dpi.inpe.br/​terrahidro/​download/​tocantins/​tocantinsDRN.zip|tocantinsDRN.zip]]\\ 
 +Tocantins ​drainage ​(GeoPackage):​ [[http://​www.dpi.inpe.br/​terrahidro/​download/​tocantins/​tocantinsDRN.gpkg|tocantinsDRN.gpkg]]\\ 
 +Tocantins drainage sources (Shapefile):​ [[http://​www.dpi.inpe.br/​terrahidro/​download/​tocantins/​tocantinsSRC.zip|tocantinsSRC.zip]]\\ 
 +Tocantins drainage sources (GeoPackage):​ [[http://​www.dpi.inpe.br/​terrahidro/​download/​tocantins/​tocantinsSRC.gpkg|tocantinsSRC.gpkg]] 
 +===== Example 1: drainage network and minibasins =====
  
-**1-** The first step is to generate ​a pitless DEM from the input DEM.+Consider as input the DEM of the Tocantins basin located at "​C:​\data\tocantinsDEM.tif"​.\\ 
 +The drainage network and minibasins can be extracted using the TerraHidro 5 console functionalities.\\ 
 + 
 +**1.** Generate ​a pitless DEM from the input DEM. \\ 
 +The removepits functionality executes the carvev, simplepits, and pfs functionalities,​ in this order.
 <​code>​ <​code>​
-C:​\data>​th removepits ​amazon_dem.tif amazon_pitless_dem.tif+C:​\data>​th removepits ​tocantinsDEM.tif tocantinsPitlessDEM.tif
 </​code>​ </​code>​
  
-**2-** The second step is to generate ​the D8 flow directions ​grid from the pitless DEM.+**2.** Generate ​the D8 flow directions from the pitless DEM.
 <​code>​ <​code>​
-C:​\data>​th d8 amazon_pitless_dem.tif amazon_d8.tif+C:​\data>​th d8 tocantinsPitlessDEM.tif tocantinsD8.tif
 </​code>​ </​code>​
  
-**3-** The third step is to generate ​the contributing area grid from the D8 flow directions ​grid.+**3.** Generate ​the contributing area from the D8 flow directions.
 <​code>​ <​code>​
-C:​\data>​th d8ca amazon_d8.tif amazon_contributing_area.tif+C:​\data>​th d8ca tocantinsD8.tif tocantinsD8ContributingArea.tif
 </​code>​ </​code>​
  
-**4-** The forth step is to generate ​the drainage network ​grid from the contributing area grid.\\ +**4.** Generate ​the drainage network from the contributing area.\\ 
-Here you will need to set the threshold value of contributing area.\\+This step requires a threshold value for the minimum ​contributing area.
 <​code>​ <​code>​
-C:​\data>​th d8drainage ​amazon_contributing_area.tif amazon_drainage.tif 1000000+C:​\data>​th d8drainage ​tocantinsD8ContributingArea.tif tocantinsDrainage.tif 1000
 </​code>​ </​code>​
  
-**5-** The final step is to generate ​the drainage network vector file from the grid file.\\+**5.** Generate ​the drainage network vector file from the grid file.
 <​code>​ <​code>​
-C:​\data>​th d8drainagev ​amazon_drainage.tif amazon_drainage.shp+C:​\data>​th d8drainagev ​tocantinsDrainage.tif tocantinsD8.tif tocantinsDrainage.shp
 </​code>​ </​code>​
  
-===== Other Applications =====+**6.** Generate the drainage network segments.\\ 
 +Each drainage segment is identified by a unique integer. 
 +<​code>​ 
 +C:​\data>​th segments tocantinsD8.tif tocantinsDrainage.tif tocantinsSegments.tif 
 +</​code>​
  
-To know all the possiple console applications just type "**th**" on a console.+**7.** Generate the drainage network minibasins. 
 +<​code>​ 
 +C:​\data>​th minibasins tocantinsD8.tif tocantinsSegments.tif tocantinsMinibasins.tif 
 +</​code>​
  
-Full List:\\+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.
  
-**carvev** - Finds and carves flat areas from a DEm in a V-shaped format.\\ +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>​ 
-**simplepits** - Try to remove ​pits by filling the pit cell. The pit is removed only if this procedure ​do not generate a new pit. Warning: ​Not generates a pitless DEM.\\ +C:​\data>​grass78.bat --tmp-location tocantinsDrainage.shp --exec generalize_line.bat 
-\\ +C:​\data>​gdal_sieve.bat -st 3 tocantinsMinibasins.tif tocantinsMinibasins3.tif 
-**pfs** - Remove ​all pits using the PFS algorithm to carve a path to an outlet cell. Generates ​a pitless DEM.\\ +C:​\data>​gdal_polygonize.bat tocantinsMinibasins3.tif -f GPKG tocantinsMinibasins.gpkg 
-\\ +C:​\data>​grass78.bat --tmp-location tocantinsMinibasins.gpkg --exec generalize_polygon.bat 
-**removepits** - This is the preferred procedure to remove all pits from a DEM. This is equivalent to perform the carvev, simplepits and pfs precedures in sequence. ​Generates ​a pitless DEM.\\ +</​code>​ 
-\\ +===== Example 2: improvements to match a reference drainage network ===== 
-**d8** - Generates the D8 flow directions grid from a pitless DEM.\\ + 
-\\ +Suppose that the user already has a reference drainage network. The quality of the D8 flow directions and, consequently,​ the minibasins can be improved by using the drainage network as input to some of the TerraHidro functionalities.\\ 
-**d8ca** - Generates the contributing area grid from a D8 flow directions grid.\\ +First, the DEM must be modified to agree with the drainage network. Next, the hydrologically consistent DEM must be generated by processing flat areas and pits also using the drainage network data.\\ 
-\\ + 
-**d8drainage** - Generates the drainage network grid from a contributing area grid.\\ +**1.** Generate a modified DEM that matches the drainage network.\\ 
-\\ +In this example, buffer size and smooth factor are not used, only the sharp factor to decrease the elevation data of the DEM at the corresponding drainage network cells. 
-**d8drainagev** - Generates the drainage network vectors from a drainage network grid.\\ +<​code>​ 
-\\ +C:​\data>​th agreedem tocantinsDEM.tif tocantinsDRN.shp 0 0 100 tocantinsAgreeDEM.tif 
-**fill** - Fills voids of a DEM data (eg SRTM 30m) using a reference DEM data (eg SRTM 90m).+</​code>​ 
 +Note: if the drainage network file is of vector type (Shapefile or GeoPackage),​ the **agreedem** functionality executes the **gdal_rasterize** command available from the QGIS installation for conversion to raster.\\ 
 +The user must add the QGIS bin directory to the path, e.g. //​C:​\Program Files\QGIS 3.22.9\bin//​. 
 + 
 +**2.** Extract the flat areas from the input DEM.\\ 
 +Minimum number of cells for flat areas must be informed. 
 +<​code>​ 
 +C:​\data>​th flatareas tocantinsDEM.tif 100 tocantinsFlatAreas.tif 
 +</​code>​ 
 + 
 +**3.** Modify the AgreeDEM on flat areas using the drainage network.\\ 
 +In this case, all directions are checked when traversing flat areas. 
 +<​code>​ 
 +C:​\data>​th carve tocantinsAgreeDEM.tif tocantinsDRN.shp tocantinsFlatAreas.tif DRNON ALL tocantinsFlatlessAgreeDEM.tif 
 +</​code>​ 
 + 
 +**4.** Remove simple pits from the flatless AgreeDEM.\\ 
 +<​code>​ 
 +C:​\data>​th simplepits tocantinsFlatlessAgreeDEM.tif tocantinsFlatlessAgreeDEM2.tif 
 +</​code>​ 
 + 
 +**5.** Generate a pitless DEM by removing complex pits.\\ 
 +The new flatless AgreeDEM is modified with the PFSD algorithm that also uses the drainage network. The pits located in the drainage network are processed first, and the other pits are selected by traversing cells in the upstream direction.\\ 
 +The D8 flow directions, contributing area, drainage network, segments, and minibasins can be generated from the flatless and pitless AgreeDEM, as shown from step 2 of the **Example 1**. 
 +<​code>​ 
 +C:​\data>​th pfsd tocantinsFlatlessAgreeDEM2.tif tocantinsDRN.shp tocantinsFlatlessPitlessAgreeDEM.tif 
 +</​code>​ 
 +===== Details about functionalities ===== 
 + 
 +This section includes a brief description of the TerraHidro functionalities used in the previous examples. More details about the carvev, simplepits, and pfs functionalities can be found in JARDIM (2017). 
 + 
 +**carvev** - Identifies and modifies flat areas by decreasing the elevation values from the border to the center. 
 + 
 +First, the flat areas are identified with a window that is moved from cell to cell. Whenever all cells inside the red window have the same elevation as the center cell, each cell of same elevation that is located inside the red and green windows is marked as flat area. 
 + 
 +{{:​carvev_flatareas.png?​nolink&​550|}} 
 + 
 +Next, the elevation of all cells identified as flat area is decreased from the border to the center. The decreasing factor is decremented at each step, so that a stair pattern is formed inside the flat area. 
 + 
 +{{:​carvev.png?​nolink&​550|}} 
 + 
 +**simplepits** - First attempt at removing pits. The pit elevation is set to the lowest elevation from a neighbor cell increased by a small increment. If all neighbors do not become a new pit, the pit is solved. 
 + 
 +{{:​simplepits.png?​nolink&​400|}} 
 + 
 +**pfs** - Performs a grid search from the pit to find the closest cell with elevation lower than the pit. Visited cells are added into a priority queue, creating a tree of paths to linearly decrease the elevation of each cell in the successful path. 
 + 
 +{{::​pfs_tree.png?​nolink&​500|}}{{:​pfs_grid.png?​nolink&​450|}} 
 + 
 +**d8** - Defines the flow direction of each cell by assigning a code that indicates to which neighbor cell the flow must continue, i.e. the neighbor cell of steepest descent. Valid flows are coded with a power of 2 from 1 to 128, whereas invalid flows with 0. 
 + 
 +Codes and corresponding flow directions:​ 
 + 
 +{{::​d8_flow_directions.png?​nolink&​200|}} 
 + 
 +Elevation and D8 flow direction grids: 
 + 
 +{{:​d8_example.png?​nolink&​350|}} 
 + 
 +**d8ca** - Computes the contributing area (accumulated flow) by following the flow directions and counting how many cells reach each cell, including the cell. 
 + 
 +{{:​d8ca.png?​nolink&​200|}} 
 + 
 +**d8drainage** - Defines the drainage network cells by assigning the value 1 if the contributing area is equal to or greater than a given threshold, otherwise assigns the value 0. 
 + 
 +{{::​d8drainage.png?​nolink&​400|}} 
 + 
 +**d8drainagev** - Creates the vector data from the rasters of the drainage network and D8 flow directions. 
 + 
 +{{::​d8drainagev.png?​nolink&​350|}} 
 + 
 +**segments** - Assigns a unique integer value to each drainage segment. The extreme points of a drainage segment are specified by one of three cases: 1. initial point and intersection point; 2. both intersection points; 3. intersection point and final point. 
 + 
 +{{:​segments.png?​nolink&​600|}} 
 + 
 +**minibasins** - Delineates the minibasins that are associated to the drainage network segments using the D8 flow directions. 
 + 
 +{{::​minibasins.png?​nolink&​600|}} 
 + 
 +**agreedem** - Modifies the DEM by sharpening the drainage network cells, i.e. decreasing the elevation values, and by optionally smoothing the cells around the drainage network given a distance buffer. 
 + 
 +{{::​agreedem01.png?​nolink&​600|}} ⇒ {{::​agreedem02.png?​nolink&​600|}} 
 + 
 +**flatareas** - Extracts flat areas from the DEM by setting as flat areas all sets of adjacent cells that contain the minimum required number of cells of same elevation. 
 + 
 +{{::​flatareas.png?​nolink&​600|}} 
 + 
 +**carve** - Removes flat areas by optionally using a drainage network that indicates the cells where elevation must be lower inside the flat area.\\ 
 +The example below shows the staircase pattern created after removing the flat area, thus decreasing elevation values from higher (red) to lower (blue) cells. 
 + 
 +{{::​carve_flatareas_drainage.png?​nolink&​600|}} ⇒ {{::​carve_staircase_pattern.png?​nolink&​600|}} 
 + 
 +**References** 
 + 
 +JARDIM, A. C. Direções de fluxo em modelos digitais de elevação: um método com foco na qualidade da estimativa e processamento de grande volume de dados. Doctoral thesis in Applied Computing. National Institute for Space Research (INPE). 2017. 
 +===== All functionalities ===== 
 + 
 +All functionalities available in the TerraHidro console application are shown by typing "​**th**"​ on the console.\\ 
 + 
 +Full list:\\ 
 + 
 +**carve** - Finds and carves flat areas from a DEM around a drainage network. 
 +<​code>​ 
 +th carve inputDEM.tif inputDrainage.shp inputFlatAreas.tif DRNON|DRNOFF CROSS|DIAG|ALL outputDEM.tif 
 +</​code>​ 
 +  * inputDEM.tif - input DEM (raster). 
 +  * inputDrainage.shp - input drainage network (vector or raster). 
 +  * inputFlatAreas.tif - input flat areas generated with the **flatareas** functionality (raster). 
 +  * DRNON|DRNOFF - parameter that indicates whether the drainage network must be used (DRNON) or not (DRNOFF) to carve the flat areas. If DRNOFF is used, the carving process converges to the center of the flat areas, which is not necessarily the river channel'​s location (similar to executing the **carvev** functionality). 
 +  * CROSS|DIAG|ALL - parameter that indicates which cells must be selected to form the border of the flat areas in the carving process (CROSS = horizontal/​vertical,​ DIAG = diagonal, ALL = all directions). 
 +  * outputDEM.tif - output DEM with flat areas carved (raster). 
 +**carvev** - Finds and carves flat areas from DEm in V-shaped format. 
 +<​code>​ 
 +th carvev inputDEM.tif outputDEM.tif 
 +</​code>​ 
 +  * inputDEM.tif - input DEM (raster). 
 +  * outputDEM.tif - output DEM with flat areas carved (raster). 
 +**simplepits** - Tries to remove ​each pit by filling the pit cell. If this procedure ​does not generate a new pit, this pit is removed. Warning: ​This operation does not generate a pitless DEM. 
 +<​code>​ 
 +th simplepits inputDEM.tif outputDEM.tif 
 +</​code>​ 
 +  * inputDEM.tif - input DEM (raster). 
 +  * outputDEM.tif - output DEM with simple pits removed (raster). 
 +**pfsd** - Removes all pits using the PFS algorithm to carve a path to an outlet cell by processing pits from the drainage network to the upstream cells. This operation ​generates a pitless DEM. 
 +<​code>​ 
 +th pfsd inputDEM.tif inputDrainage.shp outputDEM.tif 
 +</​code>​ 
 +  * inputDEM.tif - input DEM (raster). 
 +  * inputDrainage.shp - input drainage network (vector or raster). 
 +  * outputDEM.tif - output DEM with complex pits removed (raster). 
 +**pfs** - Removes ​all pits using the PFS algorithm to carve a path to an outlet cell. This operation generates ​a pitless DEM. 
 +<​code>​ 
 +th pfs inputDEM.tif outputDEM.tif 
 +</​code>​ 
 +  * inputDEM.tif - input DEM (raster). 
 +  * outputDEM.tif - output DEM with complex pits removed (raster). 
 +**removepits** - This is the preferred procedure to remove all pits from a DEM. This is equivalent to perform the carvev, simplepits and pfs precedures in sequence. ​This operation generates ​a pitless DEM. 
 +<​code>​ 
 +th removepits inputDEM.tif outputDEM.tif 
 +</​code>​ 
 +  * inputDEM.tif - input DEM (raster). 
 +  * outputDEM.tif - output DEM with flat areas carved and simple/​complex pits removed (raster). 
 +**agreedem** - Modifies a DEM to match a specified drainage network. 
 +<​code>​ 
 +th agreedem inputDEM.tif inputDrainage.shp bufferSize smoothFactor sharpFactor outputDEM.tif 
 +</​code>​ 
 +  * inputDEM.tif - input DEM (raster). 
 +  * inputDrainage.shp - input drainage network (vector or raster). 
 +  * bufferSize - buffer size around the drainage network specified either as an integer (number of cells: fixed) or a string (attribute of the input drainage network: variable). The buffer as an attribute is generated with the **flatbuffer** functionality. 
 +  * smoothFactor - smooth factor for modifying DEM values inside the buffer (in DEM vertical units, usually in meters). 
 +  * sharpFactor - sharp factor for modifying DEM values on the drainage network (in DEM vertical units, usually in meters). 
 +  * outputDEM.tif - output reconditioned DEM (raster). 
 +**tpi** - Computes the Topographic Position Index (TPI) from a DEM. 
 +<​code>​ 
 +th tpi inputDEM.tif inputWindowSize SQUARE|CIRCLE outputTPI.tif 
 +</​code>​ 
 +  * inputDEM.tif - input DEM (raster). 
 +  * inputWindowSize - window size for selecting neighbour cells to compute their average DEM elevation (in cells). 
 +  * SQUARE|CIRCLE - type of window for selecting neighbour cells (SQUARE = square window, CIRCLE = circular window). 
 +  * outputTPI.tif - output topographic position index (raster). 
 +**tps** - Computes the Topographic Position-based Stream (TPS) from a D8 flow directions grid, a contributing area grid, a TPI grid, minimum and maximum contributing area thresholds, and a TPI threshold. 
 +<​code>​ 
 +th tps inputD8.tif inputContributingArea.tif inputTPI.tif inputCAmin inputCAmax inputV outputTPS.tif 
 +</​code>​ 
 +  * inputD8.tif - input D8 flow directions generated with the **d8** functionality (raster). 
 +  * inputContributingArea.tif - input contributing area (accumulated flow) generated with the **d8ca** functionality (raster). 
 +  * inputTPI.tif - input topographic position index generated with the **tpi** functionality (raster). 
 +  * inputCAmin - minimum threshold of contributing area. 
 +  * inputCAmax - maximum threshold of contributing area. 
 +  * inputV - threshold of topographic position index (TPI). 
 +  * outputTPS.tif - output topographic position-based stream (raster). 
 +**flatareas** - Extracts flat areas from a DEM. 
 +<​code>​ 
 +th flatareas inputDEM.tif minFlatAreaCells outputFlatAreas.tif 
 +</​code>​ 
 +  * inputDEM.tif - input DEM (raster). 
 +  * minFlatAreaCells - minimum number of cells for flat areas. 
 +  * outputFlatAreas.tif - output flat areas (raster). 
 +**flatbuffer** - Generates buffer sizes around a drainage network from flat areas and extracts drainage points with buffer. 
 +<​code>​ 
 +th flatbuffer inputDrainage.shp inputFlatAreas.tif inputBufferAttribute IN|INOUT MED|EQD inputEquidistance outputDrainage.shp outputPoints.shp 
 +</​code>​ 
 +  * inputDrainage.shp - input drainage network (vector). 
 +  * inputFlatAreas.tif - input flat areas generated with the **flatareas** functionality (raster). 
 +  * inputBufferAttribute - input name of the buffer attribute (string) to be added to the output drainage network. 
 +  * IN|INOUT - parameter that specifies which points must be selected to compute buffer values for each drainage segment (IN = only inside flat areas, INOUT = inside and outside flat areas). 
 +  * MED|EQD - parameter that specifies the location of the output points generated with buffer (MED = mean point of subsegments of drainage segment, EQD = equidistant points on drainage segment). 
 +  * inputEquidistance - input distance value for the equidistant points that is used only if the EQD parameter is informed. 
 +  * outputDrainage.shp - output drainage network with attribute of buffer size added to the attribute table. The buffer values are associated to each drainage segment. 
 +  * outputPoints.shp - output points generated on the drainage network with attribute of buffer size added to the attribute table. The points are either mean points (MED) or equidistant points (EQD). 
 +**d8** - Generates the D8 flow directions grid from a pitless DEM. 
 +<​code>​ 
 +th d8 inputDEM.tif outputD8.tif 
 +</​code>​ 
 +  * inputDEM.tif - input DEM (raster). 
 +  * outputD8.tif - output D8 flow directions (raster). 
 +**d8ca** - Generates the contributing area grid from a D8 flow directions grid. 
 +<​code>​ 
 +th d8ca inputD8.tif outputD8ContributingArea.tif 
 +</​code>​ 
 +  * inputD8.tif - input D8 flow directions (raster). 
 +  * outputD8ContributingArea.tif - output D8 contributing area or accumulated flow (raster). 
 +**d8drainage** - Generates the drainage network grid from a contributing area grid. 
 +<​code>​ 
 +th d8drainage inputContributingArea.tif outputDrainage.tif thresholdValue 
 +</​code>​ 
 +  * inputContributingArea.tif - input D8 contributing area (raster). 
 +  * outputDrainage.tif - output drainage network (raster). 
 +  * thresholdValue - threshold value of contributing area to select cells for the drainage network (in cells). 
 +**d8drainagev** - Generates the drainage network vectors from a drainage network grid. 
 +<​code>​ 
 +th d8drainagev inputDrainage.tif inputD8.tif outputDrainage.shp 
 +</​code>​ 
 +  * inputDrainage.tif - input drainage network (raster). 
 +  * inputD8.tif - input D8 flow directions (raster). 
 +  * outputDrainage.shp - output drainage network (vector). 
 +**hand** - Generates the HAND height grid from a DEM grid, a D8 flow directions grid and a drainage network grid. 
 +<​code>​ 
 +th hand inputDEM.tif inputD8.tif inputDrainage.tif outputHAND.tif 
 +</​code>​ 
 +  * inputDEM.tif - input DEM (raster). 
 +  * inputD8.tif - input D8 flow directions (raster). 
 +  * inputDrainage.tif - input drainage network (raster). 
 +  * outputHAND.tif - output Height Above Nearest Drainage (raster). 
 +**sand** - Generates the SAND slope grid from a DEM grid, a D8 flow directions grid, and a drainage network grid. 
 +<​code>​ 
 +th sand inputDEM.tif inputD8.tif inputDrainage.tif outputSAND.tif 
 +</​code>​ 
 +  * inputDEM.tif - input DEM (raster). 
 +  * inputD8.tif - input D8 flow directions (raster). 
 +  * inputDrainage.tif - input drainage network (raster). 
 +  * outputSAND.tif - output Slope Above Nearest Drainage (raster). 
 +**segments** - Generates the segments from a D8 flow directions grid and a drainage network grid. 
 +<​code>​ 
 +th segments inputD8.tif inputDrainage.tif outputSegments.tif 
 +</​code>​ 
 +  * inputD8.tif - input D8 flow directions (raster). 
 +  * inputDrainage.tif - input drainage network (raster). 
 +  * outputSegments.tif - output drainage network segments coded with unique integer values (raster). 
 +**minibasins** - Generates the minibasins from a D8 flow directions grid and a segments network grid. 
 +<​code>​ 
 +th minibasins inputD8.tif inputSegments.tif outputMinibasins.tif 
 +</​code>​ 
 +  * inputD8.tif - input D8 flow directions (raster). 
 +  * inputSegments.tif - input drainage network segments (raster). 
 +  * outputMinibasins.tif - output minibasins associated to the input segments coded with the same unique integer values (raster). 
 +**outletbasin** - Generates the outlet basin from a D8 flow directions grid, and row and column of an outlet point. 
 +<​code>​ 
 +th outletbasin inputD8.tif inputOutletrow inputOutletcolumn outputOutletbasin.tif 
 +</​code>​ 
 +  * inputD8.tif - input D8 flow directions (raster). 
 +  * inputOutletrow - grid row of the outlet cell of the basin to be delineated. 
 +  * inputOutletcolumn - grid column of the outlet cell of the basin to be delineated. 
 +  * outputOutletbasin.tif - output basin delineated from the outlet cell (raster). 
 +**d8slope** - Generates slope from D8 flow directions. 
 +<​code>​ 
 +th d8slope inputDEM.tif inputD8.tif outputD8Slope.tif 
 +</​code>​ 
 +  * inputDEM.tif - input DEM (raster). 
 +  * inputD8.tif - input D8 flow directions (raster). 
 +  * outputD8Slope.tif - output slope computed from each D8 flow direction between neighbouring cells (raster). 
 +**d8upscale** - Upscales a drainage network grid. 
 +<​code>​ 
 +th d8upscale inputD8.tif inputD8ContributingArea.tif outputUpscaleRaster.tif outletPixelsRaster.tif factor [mufp] [at] 
 +</​code>​ 
 +  * inputD8.tif - input D8 flow directions (raster). 
 +  * inputD8ContributingArea.tif - input D8 contributing area (raster). 
 +  * outputUpscaleRaster.tif - output D8 flow directions upscaled by factor using the D8 contributing area for better estimation (raster). 
 +  * outletPixelsRaster.tif - output outlet pixels (raster). 
 +  * factor - input upscale factor (integer). 
 +  * mufp - input minimum upstream flow path (integer, optional, default = factor/​5). 
 +  * at - input contributing area threshold (integer, optional, default = factor^2). 
 +**flowpath** - Generates flow paths from sources. 
 +<​code>​ 
 +th flowpath inputD8.tif inputSources.shp outputFlowPaths.tif 
 +</​code>​ 
 +  * inputD8.tif - input D8 flow directions (raster). 
 +  * inputSources.shp - input drainage source points to initiate flow paths (vector). 
 +  * outputFlowPaths.tif - output flow paths that follow the D8 flow directions from each drainage source point (raster). 
 +**fill** - Fills voids of a DEM data (e.g. SRTM 30 m) using a reference DEM data (e.g. SRTM 90 m)
 +<​code>​ 
 +th fill inputDEM.tif referenceDEM.tif outputDEM.tif 
 +</​code>​ 
 +  * inputDEM.tif - input DEM (raster). 
 +  * referenceDEM.tif - input reference DEM with data to be used for filling (raster). 
 +  * outputDEM.tif - output DEM with voids filled from the reference DEM (raster). 
 +**d8toupstream** - Generates the upstream flow directions from a D8 flow directions grid. 
 +<​code>​ 
 +th d8toupstream inputD8.tif outputUpstream.tif 
 +</​code>​ 
 +  * inputD8.tif - input D8 flow directions (raster). 
 +  * outputUpstream.tif - output D8 upstream flow directions computed as the sum of the D8 flow directions (raster). 
 +**mouths** - Generates the drainage mouths from a D8 flow directions grid and a drainage network grid. 
 +<​code>​ 
 +th mouths inputD8.tif inputDrainage.tif outputMouths.txt 
 +</​code>​ 
 +  * inputD8.tif - input D8 flow directions (raster). 
 +  * inputDrainage.tif - input drainage network (raster). 
 +  * outputMouths.txt - output mouths (grid coordinates),​ i.e. the cells where the drainage flows end (text file). 
 +**orderedmouths** - Generates the ordered drainage mouths by accumulated area from an accumulated area grid and a mouths text file. 
 +<​code>​ 
 +th orderedmouths inputContributingArea.tif inputMouths.txt outputOrderedMouths.txt 
 +</​code>​ 
 +  * inputContributingArea.tif - input D8 contributing area (raster). 
 +  * inputMouths.txt - input mouths (grid coordinates) (text file). 
 +  * outputOrderedMouths.txt - output mouths (grid coordinates) ordered by contributing area from higher to lower values (text file). 
 +**rivers** - Generates the separated rivers and sources from an D8 upstream flow directions grid, a drainage grid, contributing area grid and a mouths text file. 
 +<​code>​ 
 +th rivers inputD8upstream.tif inputDrainage.tif inputAccumulatedArea.tif inputMouths.txt outputRivers.tif outputSources.txt 
 +</​code>​ 
 +  * inputD8upstream.tif - input D8 upstream flow directions (raster). 
 +  * inputDrainage.tif - input drainage network (raster). 
 +  * inputAccumulatedArea.tif - input D8 contributing area (raster). 
 +  * inputMouths.txt - input mouths (grid coordinates) (text file). 
 +  * outputRivers.tif - output rivers formed by all drainage segments that converge to each mouth coded with unique integer values (raster). 
 +  * outputSources.txt - output sources (grid coordinates) of all rivers (text file). 
 +**ottorivers** - Generates the otto codification of rivers from an D8 upstream flow directions grid, a drainage grid, contributing area grid and a mouths text file. 
 +<​code>​ 
 +th ottorivers inputD8upstream.tif inputDrainage.tif inputAccumulatedArea.tif inputMouths.txt outputOttoRivers.tif outputNewLevelMouths.txt 
 +</​code>​ 
 +  * inputD8upstream.tif - input D8 upstream flow directions (raster). 
 +  * inputDrainage.tif - input drainage network (raster). 
 +  * inputAccumulatedArea.tif - input D8 contributing area (raster). 
 +  * inputMouths.txt - input mouths (grid coordinates) (text file). 
 +  * outputOttoRivers.tif - output ottorivers with five segments of main river and four main tributaries ottoencoded (raster). 
 +  * outputNewLevelMouths.txt - output mouths and sources (grid coordinates) of segments and tributaries of ottorivers for the next level of ottoencoding (text file). 
 +**ottobasins** - Generates the otto codification of basins from an D8 upstream flow directions grid, a Otto rivers grid. 
 +<​code>​ 
 +th ottobasins inputD8.tif inputOttoRivers.tif outputOttoBasins.tif 
 +</​code>​ 
 +  * inputD8.tif - input D8 flow directions (raster). 
 +  * inputOttoRivers.tif - input ottorivers with codes of main river'​s segments and tributaries (raster). 
 +  * outputOttoBasins.tif - output ottobasins associated to the ottorivers coded with the same unique integer values (raster). 
 +**mainriver** - Generates the main river from an D8 upstream flow directions grid, a drainage grid, contributing area grid and a mouth text file. 
 +<​code>​ 
 +th mainriver inputD8upstream.tif inputDrainage.tif inputAccumulatedArea.tif inputMouth.txt outputRiver.tif 
 +</​code>​ 
 +  * inputD8upstream.tif - input D8 upstream flow directions (raster). 
 +  * inputDrainage.tif - input drainage network (raster). 
 +  * inputAccumulatedArea.tif - input D8 contributing area (raster). 
 +  * 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). 
 +**shreve** - Generates the Shreve stream order from an D8 flow directions grid, a drainage grid, and a sources text file. 
 +<​code>​ 
 +th shreve inputD8.tif inputDrainage.tif inputSources.txt outputShreve.tif 
 +</​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. 
 +<​code>​ 
 +th strahler inputD8.tif inputDrainage.tif inputSources.txt outputStrahler.tif 
 +</​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 ===== 
 + 
 +The TerraHidro Plugin for QGIS Processing Toolbox provides QGIS and TerraHidro users the interfaces that allow to execute all TerraHidro functionalities inside QGIS. First, the TerraHidro Plugin must be installed from the Plugins ⇒ Manage and Install Plugins option available in the QGIS menu bar. Just type in "​terrahidro"​ in the search box, select the TerraHidro plugin, and click Install Plugin. Please, check the option "Show experimental plugins"​ under Options in the left menu. In addition, it is necessary to create an environment variable called TERRAHIDRO that points to the directory where the TerraHidro executable was extracted. 
 + 
 +{{::​plugin_terrahidro_install.png?​nolink&​600|}} 
 + 
 +After the installation,​ the TerraHidro Plugin is added to the QGIS Processing Toolbox. The TerraHidro functionalities are organized in different groups, where each group includes the functionalities related to the type of processing required by the user, i.e. Basin, DEM, Drainage, and Flow tools. 
 + 
 +{{::​toolbox.png?​nolink&​300|}} 
 + 
 +For example, if the user wants to generate a reconditioned DEM using a drainage network, the agreedem functionality can be executed from the corresponding option found under the DEM Tools group. After opening the AgreeDEM interface, the input raster and vector data must be selected from the layers already inserted into the QGIS project together with the other input data values, as well as the output data to be generated. 
 + 
 +{{::​plugin_agreedem01.png?​nolink&​500|}} ⇒ {{::​plugin_agreedem02.png?​nolink&​500|}} ⇒ {{::​plugin_agreedem03.png?​nolink&​500|}} 
 + 
 +As another example, the user can generate a drainage network that is traced from particular points specified as drainage sources. These points are informed as input data together with the D8 flow directions to form the flow paths that define the drainage network.
  
 +{{::​plugin_flowpath01.png?​nolink&​500|}} ⇒ {{::​plugin_flowpath02.png?​nolink&​500|}} ⇒ {{::​plugin_flowpath03.png?​nolink&​500|}}
 ===== Contact ===== ===== Contact =====
-Write to TerraHidro Team at <​terrahidro@dpi.inpe.br>​ 
  
 +Write to the TerraHidro Team at <​henrique.renno@inpe.br>​ (developer) or <​sergio.rosim@inpe.br>​ (manager).
 ===== Previous Version ===== ===== Previous Version =====
-[[http://​wiki.dpi.inpe.br/​doku.php?​id=terrahidro|TerraHidro 0.4.X]]+ 
 +TerraHidro developed with Terralib 4: [[http://​wiki.dpi.inpe.br/​doku.php?​id=terrahidro|TerraHidro 0.4.X]] 
 + 
 +This previous version of the TerraHidro system is not under development anymore, but it is still supported by the TerraHidro team.
 ===== Copyright ===== ===== Copyright =====
 Copyright (C) 2008-2014 National Institute For Space Research (INPE) - Brazil.\\ Copyright (C) 2008-2014 National Institute For Space Research (INPE) - Brazil.\\

QR Code
QR Code start (generated for current page)