Note: This addon document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade your GRASS GIS installation, and read the current addon manual page.
# Choose elevation map and threshold elevation = srtm threshold = 1E6 # [m**2], minimum catchment size = 1 km**2 # Build a map of cell areas: pick one of these # km2 is more intuitive, but 1 km2 is the threshold for the smallest # threshold catchment size r.mapcalc('cellArea_meters2 = '+str(reg.nsres)+' * '+str(reg.ewres), overwrite=True) r.mapcalc("cellArea_km2 = cellArea_meters2 / 10^6", overwrite=True) # Use r.watershed to build a drainage basin with units of length**2 # instead of arbitrary units (cells) r.watershed(elevation=elevation, flow='cellArea_meters2', accumulation='drainageArea_m2', drainage='drainageDirection', stream='streams', threshold=thresh, flags='s', overwrite=True) # Note that this will include areas of negative (i.e. offmap) flow accumulation # Build watershed network using r.stream.extract: single-flow-direction (SFD) print "Building drainage network" r.stream_extract(elevation=elevation, accumulation='drainageArea_m2', threshold=thresh, d8cut=0, mexp=0, stream_raster='streams', stream_vector='streams', direction='draindir', overwrite=True)
Available at: v.stream.network source code (history)
Latest change: Mon Jun 28 07:54:09 2021 in commit: 1cfc0af029a35a5d6c7dae5ca7204d0eb85dbc55
Note: This addon document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade your GRASS GIS installation, and read the current addon manual page.
Main index | Vector index | Topics index | Keywords index | Graphical index | Full index
© 2003-2023 GRASS Development Team, GRASS GIS 7.8.8dev Reference Manual