1r.lake(1) Grass User's Manual r.lake(1)
2
3
4
6 r.lake - Fills lake from seed at given level
7
9 raster
10
12 r.lake
13 r.lake help
14 r.lake [-no] dem=name wl=float [lake=name] [xy=east,north]
15 [seed=name] [--overwrite]
16
17 Flags:
18 -n Use negative depth values for lake raster map
19
20 -o Overwrite seed map with result (lake) map
21
22 --overwrite
23
24 Parameters:
25 dem=name
26 Terrain raster map (DEM)
27
28 wl=float
29 Water level
30
31 lake=name
32 Output raster map with lake
33
34 xy=east,north
35 Seed point coordinates
36
37 seed=name
38 Raster map with seed (at least 1 cell > 0)
39
41 The module fills a lake to a target water level from a given start
42 point. The user can think of it as r.grow with additional checks for
43 elevation. The resulting raster map contains cells with values repre‐
44 senting lake depth and NULL for all other cells beyond the lake.
45
46 This module uses a 3x3 moving window approach to find all cells that
47 match three criteria and to define the lake:
48
49 cells are below the specified elevation (i.e., water
50 level);
51
52 cells are connected with an initial cell (seed or E,N
53 value);
54
55 cells are not NULL or masked.
56
57 The water level must be in DEM units.
58
59 The seed (starting) point can be a raster map with at least one cell
60 value greater than zero, or a seed point can be specified as an E, N
61 coordinate pair. If the seed is specified as a coordinate pair, an
62 additional check is done to make sure that the target water level is
63 above the level of the DEM. When a raster map is used as a seed, how‐
64 ever, no such checks are done. Specifying a target water level below
65 surface represented by DEM will result in an empty map. Note: a raster
66 lake map created in a previous run can also be used as a seed map for a
67 new run to simulate rising water levels.
68
69 The module will create a new map (lake=foo) or can be set to replace
70 the input (seed=bar) map if the -o flag is used. The user can use -o
71 flag to create animations of rising water level without producing a
72 separate map for each frame. An initial seed map must be created to
73 start the sequence, and will be overwritten during subsequent runs with
74 resulting water levels maps (i.e., a single file serves for both input
75 and output).
76
77 Negative output (the -n flag) is useful for visualisations in NVIZ. It
78 equals the mapcalc's expression "negative = 0 - positive".
79
81 The entire map is loaded into RAM.
82
83 The module is NOT large file safe. (due to the previous
84 point)
85
86 A completely negative seed map will not work! At least
87 one cell must have a value >0. Output from r.lake -n can
88 NOT be used as input in the next run.
89
91 This module was initially created as a script using r.mapcalc. This had
92 some limitations - it was slow and no checks where done to find out
93 required iteration count. The shell script code (using r.mapcalc) used
94 in the original script is shown below:
95 ${seedmap} = if( ${dem}, \
96 if( if( isnull(${seedmap}),0,${seedmap}>0), ${wlevel}-${dem}, \
97 if( \
98 if(isnull(${seedmap}[-1,0]),0, ${seedmap}[-1,0]>0 &&
99 ${wlevel}>${dem}) ||\
100 if(isnull(${seedmap}[-1,1]),0, ${seedmap}[-1,1]>0 &&
101 ${wlevel}>${dem}) ||\
102 if(isnull(${seedmap}[0,1]), 0, ${seedmap}[0,1]>0 &&
103 ${wlevel}>${dem}) ||\
104 if(isnull(${seedmap}[1,1]), 0, ${seedmap}[1,1]>0 &&
105 ${wlevel}>${dem}) ||\
106 if(isnull(${seedmap}[1,0]), 0, ${seedmap}[1,0]>0 &&
107 ${wlevel}>${dem}) ||\
108 if(isnull(${seedmap}[1,-1]),0, ${seedmap}[1,-1]>0 &&
109 ${wlevel}>${dem}) ||\
110 if(isnull(${seedmap}[0,-1]),0, ${seedmap}[0,-1]>0 &&
111 ${wlevel}>${dem}) ||\
112 if(isnull(${seedmap}[-1,-1]),0, ${seedmap}[-1,-1]>0 &&
113 ${wlevel}>${dem}),\
114 ${wlevel}-${dem}, null() )))
115 The ${seedmap} variable is replaced by seed map names, ${dem} with DEM
116 map name, and ${wlevel} with target water level. To get single water
117 level, this code block is called with same level numerous times (in a
118 loop) as the lake grows by single cells during single run.
119
121 r.mapcalc, r.grow, r.plane
122
124 Maris Nartiss (maris.nartiss gmail.com)
125
126 Last changed: $Date: 2006/05/23 16:50:05 $
127
128 Full index
129
130
131
132GRASS 6.2.2 r.lake(1)