BasinShape¶
Converts a raster of numbered basins, as the sub-basins of NetNumbering, into polygons, with the area, the perimeter and the elevation statistics of each basin in the attributes table. The polygons bring the sub-basins into the vector tools: to label and query them, to join other data to them, or to use them as the hydrological response units of the semi-distributed models.
Details¶
Each basin of the input map becomes a polygon with the attributes netnum, the basin number; area and perimeter, in the units of the map CRS; maxelev, minelev and avgelev, the statistics of the elevation of its cells; height, the elevation at the centroid of the polygon, -1 where the centroid is not on a valid cell.
Parameters¶
Creates a Feature collection of the subbasins created with the netnumbering module.
Toolbox folder: Basin
Status: Certified
Keywords: Basin, Geomorphology
Authors: Erica Ghesla, Andrea Antonello
Class: org.hortonmachine.modules.BasinShape
Inputs
Parameter |
Type |
Unit |
Default |
Description |
|---|---|---|---|---|
|
raster file |
The elevation map. |
||
|
raster file |
The map of the numbered basins. |
Outputs
Parameter |
Type |
Unit |
Description |
|---|---|---|---|
|
output file |
The extracted basins vector map. |
Example¶
The example runs on the sample elevation model of the manual, dtm_flanginec.tif in docs/manual/modules/maps/data, each module on the outputs of the previous ones:
import org.hortonmachine.modules.BasinShape
// the folder with the elevation model: change it to yours
var folder = "/data/flanginec/"
var basinShape = new BasinShape()
// the sub-basins of NetNumbering
basinShape.inBasins = folder + "subbasins.tif"
basinShape.inElev = folder + "pit.tif"
basinShape.outBasins = folder + "subbasins.shp"
basinShape.process()
The sub-basins of NetNumbering as polygons, colored by their mean elevation in meters.¶