.TH r.flow 1 "" "" "" "" .SH \*LNAME\*O \*L\*Wr.flow \*O\*O- construction of slope curves (flowlines), flowpath lengths, and flowline densities (upslope areas) from a raster digital elevation model(DEM) .PP \*W(GRASS Raster/Vector Program)\*O .br .SH SYNOPSIS \*Lr.flow\*O .br \*Lr.flow \*Ohelp .br \*Lr.flow [ -u3mMqh ] elevin \*O= name [ \*Laspin \*O= name ] [ \*Lbarin \*O= name ] [ \*Lskip \*O= val ] [ \*Lbound \*O= val ] [ \*Loffset \*O= val ] [ \*Lflout \*O= name ] [ \*Llgout \*O= name ] [ \*Ldsout \*O= name ] .br .br .SH DESCRIPTION This program\*L \*Ogenerates flowlines using a combined raster-vector approach (see\*L Mitasova and Hofierka 1993 \*Oand \*LMitasova et al. 1995)) from an input elevation raster map \*Welevin\*O\*L \*O(integer or floating point), and optionally an input aspect raster map \*Waspin\*O and/or an input barrier raster map \*Wbarin\*O. There are three possible output maps which can be produced in any combination simultaneously: a vector file \*Wflout\*O of flowlines, a raster map \*Wlgout\*O of flowpath lengths, and a raster map \*Wdsout\*O of flowline densities (which are equal upslope contributed areas per unit width, when multiplied by resolution). .PP Aspect used for input must follow the same rules as aspect computed in other GRASS programs (see \*Ls.surf.rst\*O or \*Lr.slope.aspect\*O). .PP Flowline output is given in a vector map \*Wflout\*O, (flowlines generated downhill). The line segments of flowline vectors have endpoints on edges of a grid formed by drawing imaginary lines through the centers of the cells in the elevation map. Flowlines are generated from each cell downhill by default; they can be generated uphill using the flag \*W-u\*O. A flowline stops if its next segment would reverse the direction of flow (from up to down or vice-versa), cross a barrier, or arrive at a cell with undefined elevation or aspect. Another option, \*Wskip\*O=val, indicates that only the flowlines from every val-th cell are to be included in \*Wflout\*O. The default \*Wskip\*O is max(1, elevin/50). A high \*Wskip\*O usually speeds up processing time and often improves the readability of a visualization of \*Wflout\*O. .PP Flowpath length output is given in a raster map \*Wlgout\*O. The value in each grid cell is the sum of the planar lengths of all segments of the flowline generated from that cell. If the flag \*W-3\*O is given, elevation is taken into account in calculating the length of each segment. .PP Flowline density downhill or uphill output is given in a raster map \*Wdsout.\*O The value in each grid cell is the number of flowlines which pass through that grid cell, that means the number of flowlines from the entire map which have segment endpoints within that cell. .br .SH OPTIONS The program will run non-interactively if the user specifies program arguments and flag settings on the command line using the following form: .PP \*Lr.flow [ -u3mMqh ] elevin \*O= name [ \*Laspin \*O= name ] [ \*Lbarin \*O= name ] [ \*Lskip \*O= val ] [ \*Lbound \*O= val ] [ \*Loffset \*O= val ] [ \*Lflout \*O= name ] [ \*Llgout \*O= name ] [ \*Ldsout \*O= name ]. .PP Alternatively, the user can simply type \*Lr.flow\*O on the command line and the program will ask for parameter values and flag settings interactively, using the standard GRASS parser interface. .br .SH \*LFlags:\*O \*L-u\*O Generate flowlines uphill (default generates flowlines downhill). .PP \*L-3\*O Compute three-dimensional lengths (default is two-dimensional). .PP \*L-m\*O Use less memory and compute aspect at each cell on the fly. This option incurs a severe performance penalty. If this flag is given, the aspect input map (if any) will be ignored. .PP \*L-M\*O Use a fixed size memory and utilize page-swapping to handle large input files. This option incurs a severe performance penalty but is the only way to handle arbitrarily-large data files. If this flag is given, the \fB-m\fR flag will be ignored. .PP \*L-q\*O Quiet operation. Do not print diagnostic messages indicating progress. .PP \*L-h\*O Display reference information. .br .SH \*LParameters:\*O \*Lelevin\*O=\*Wname\*O .br Use the existing raster file name with elevations as input (required). .br \*Laspin\*O=\*Wname\*O .br Use the existing raster file name with aspects as input. .br \*Lbarin\*O=\*Wname\*O .br Use the existing raster file name with non-zero values representing barriers as input. .br \*Lskip\*O=\*Wval\*O .br Set the number of cells between flowlines in the \*Lflout\*O output map to val. .br \*Lbound\*O=\*Wval\*O .br Set the maximum number of segments of each flowline to val (default is the maximum possible). .br \*Loffset\*O=\*Wval\*O .br Maximum magnitude of random grid point offset (default is 0). .br \*Lflout\*O=\*Wname\*O .br Output coordinates of flowlines to a vector file name. .br \*Llgout\*O=\*Wname\*O .br Output flowpath length values to a raster file name. .br \*Ldsout\*O=\*Wname\*O .br Output flowline density values to a raster file name. .br .SH NOTES For best results, use input elevation maps with high precision units (e.g., centimeters) so that flowlines do not terminate prematurely in flat areas. To prevent the creation of tiny flowline segments with imperceivable changes in elevation, an endpoint which would land very close to the center of a grid cell is quantized to the exact center of that cell. The maximum distance between the intercepts along each axis of a single diagonal segment and another segment of 1/2 degree different aspect is taken to be "very close" for that axis. Note that this distance (the so-called "quantization error") is about 1-2% of the resolution on maps with square cells. .PP The values in length maps computed using the \*L-u\*O flag represent the distances from each cell to an upland flat or singular point. Such distances are useful in water erosion modeling for computation of the LS factor in the standard form of USLE. Uphill flowlines merge on ridge lines; by redirecting the order of the flowline points in the output vector map, dispersed waterflow can be simulated. The density map can be used for the extraction of ridge lines. .PP Computing the flowlines downhill simulates the actual flow (also known as the raindrop method). These flowlines tend to merge in valleys; they can be used for localization of areas with waterflow accumulation and for the extraction of channels. The downslope flowline density multiplied by the resolution can be used as an approximation of the upslope contributing area per unit contour width. This area is a measure of potential water flux for the steady state conditions and can be used in the modeling of water erosion for the computation of the unit stream power based LS factor or sediment transport capacity. .PP The program has been designed for modeling erosion on hillslopes and has rather strict conditions for ending flowlines. It is therefore not very suitable for the extraction of stream networks or delineation of watersheds unless a DEM without pits or flat areas is available. .SH DIAGNOSTICS ERROR: GISRC - variable not set .PP The program was run outside of GRASS. .PP Usage: r.flow [-u3mMqh] elevin=name [aspin=name] [barin=name] [skip=value] [bound=value] [offset=value] [flout=name] [lgout=name] [dsout=name] .PP Invalid options were specified on the command line. .PP ERROR: r.flow: error getting current region .PP ERROR: r.flow: unable to reset current region .PP ERROR: r.flow: cannot open vector file .PP "ERROR: r.flow: cell file " filename " not found" .PP "ERROR: r.flow: cannot get header for " filename .PP "ERROR: r.flow: unable to create raster map " filename .PP Self-explanatory or beyond explanation. .PP "ERROR: r.flow: " input " file's resolution differs from current" region resolution .PP The resolutions of all input files and the current region must match. .PP "ERROR: r.flow: resolution too unbalanced (" val " x " val ")" The difference in length between the two axes of a grid cell is so great that quantization error is larger than one of the dimensions. Resample the map and try again. .br .SH SEE ALSO .PP \*Lr.basins.fill\*O, \*Lr.water.outlet.html\*O , \*Lr.watershed\*O .br .SH AUTHORS .PP \*WOriginal version of program:\*O .br Maros Zlocha and Jaroslav Hofierka, Comenius University, Bratislava, Slovakia, .PP \*WThe current version of the program (adapted for GRASS5.0)\*O: .br Joshua Caplan, Mark Ruesink, Helena Mitasova, University of Illinois at Urbana-Champaign with support from USA CERL. .br .SH REFERENCES .PP Mitasova and Hofierka 1993 : Interpolation by Regularized Spline with Tension: II. Application to Terrain Modeling and Surface Geometry Analysis. Mathematical Geology 25(6), 641-650. .PP Mitasova, H., Mitas, L., Brown, W.M., Gerdes, D.P., Kosinovsky, I., Baker, T., 1995: Modeling spatially and temporally distributed phenomena: New methods and tools for GRASS GIS. International Journal of Geographical Information Systems 9(4), 433-446. .PP Mitasova, H., Hofierka, J., Zlocha, M., Iverson, L., 1996, Modeling topographic potential for erosion and deposition using GIS. Int. Journal of GIS, v. 10, no. 5, p. 629-641. .PP Mitasova, H.(1993): Surfaces and modeling. Grassclippings (winter and spring) p.18-19.