1r.lake(1) Grass User's Manual r.lake(1)
2
3
4
6 r.lake - Fills lake at given point to given level.
7
9 raster, hydrology, hazard, flood
10
12 r.lake
13 r.lake --help
14 r.lake [-no] elevation=name water_level=float [lake=name] [coordi‐
15 nates=east,north] [seed=name] [--overwrite] [--help] [--verbose]
16 [--quiet] [--ui]
17
18 Flags:
19 -n
20 Use negative depth values for lake raster map
21
22 -o
23 Overwrite seed map with result (lake) map
24
25 --overwrite
26 Allow output files to overwrite existing files
27
28 --help
29 Print usage summary
30
31 --verbose
32 Verbose module output
33
34 --quiet
35 Quiet module output
36
37 --ui
38 Force launching GUI dialog
39
40 Parameters:
41 elevation=name [required]
42 Name of input elevation raster map
43
44 water_level=float [required]
45 Water level
46
47 lake=name
48 Name for output raster map
49
50 coordinates=east,north
51 Seed point coordinates
52 Either this coordinates pair or a seed map have to be specified
53
54 seed=name
55 Input raster map with given starting point(s) (at least 1 cell > 0)
56 Either this parameter or a coordinates pair have to be specified
57
59 The module fills a lake to a target water level from a given start
60 point. The user can think of it as r.grow with additional checks for
61 elevation. The resulting raster map contains cells with values repre‐
62 senting lake depth and NULL for all other cells beyond the lake. Lake
63 depth is reported relative to specified water level (specified level =
64 0 depth).
65
66 This module uses a 3x3 moving window approach to find all cells that
67 match three criteria and to define the lake:
68
69 · cells are below the specified elevation (i.e., water level);
70
71 · cells are connected with an initial cell (seed or coordinates
72 pair value);
73
74 · cells are not NULL or masked.
75
76 The water level must be in DEM units.
77
79 The seed (starting) point can be a raster map with at least one cell
80 value greater than zero, or a seed point can be specified as an E, N
81 coordinate pair. If the seed is specified as a coordinate pair, an
82 additional check is done to make sure that the target water level is
83 above the level of the DEM. When a raster map is used as a seed, how‐
84 ever, no such checks are done. Specifying a target water level below
85 surface represented by DEM will result in an empty map. Note: a raster
86 lake map created in a previous run can also be used as a seed map for a
87 new run to simulate rising water levels.
88
89 The module will create a new map (lake=foo) or can be set to replace
90 the input (seed=bar) map if the -o flag is used. The user can use -o
91 flag to create animations of rising water level without producing a
92 separate map for each frame. An initial seed map must be created to
93 start the sequence, and will be overwritten during subsequent runs with
94 resulting water levels maps (i.e., a single file serves for both input
95 and output).
96
97 Negative output (the -n flag) is useful for visualisations in NVIZ. It
98 equals the mapcalc’s expression "negative = 0 - positive".
99
100 r.mapcalc equivalent - for GRASS hackers
101 This module was initially created as a script using r.mapcalc. This
102 had some limitations - it was slow and no checks where done to find out
103 required iteration count. The shell script code (using r.mapcalc) used
104 in the original script is shown below:
105 ${seedmap} = if( ${dem}, \
106 if( if( isnull(${seedmap}),0,${seedmap}>0), ${wlevel}-${dem}, \
107 if( \
108 if(isnull(${seedmap}[-1,0]),0, ${seedmap}[-1,0]>0 && ${wlevel}>${dem}) ||\
109 if(isnull(${seedmap}[-1,1]),0, ${seedmap}[-1,1]>0 && ${wlevel}>${dem}) ||\
110 if(isnull(${seedmap}[0,1]), 0, ${seedmap}[0,1]>0 && ${wlevel}>${dem}) ||\
111 if(isnull(${seedmap}[1,1]), 0, ${seedmap}[1,1]>0 && ${wlevel}>${dem}) ||\
112 if(isnull(${seedmap}[1,0]), 0, ${seedmap}[1,0]>0 && ${wlevel}>${dem}) ||\
113 if(isnull(${seedmap}[1,-1]),0, ${seedmap}[1,-1]>0 && ${wlevel}>${dem}) ||\
114 if(isnull(${seedmap}[0,-1]),0, ${seedmap}[0,-1]>0 && ${wlevel}>${dem}) ||\
115 if(isnull(${seedmap}[-1,-1]),0, ${seedmap}[-1,-1]>0 && ${wlevel}>${dem}),\
116 ${wlevel}-${dem}, null() )))
117
118 The ${seedmap} variable is replaced by seed map names, ${dem} with DEM
119 map name, and ${wlevel} with target water level. To get single water
120 level, this code block is called with same level numerous times (in a
121 loop) as the lake grows by single cells during single run.
122
124 · The entire map is loaded into RAM.
125
126 · A completely negative seed map will not work! At least one cell
127 must have a value > 0. Output from r.lake -n cannot be used as
128 input in the next run.
129
131 Example of small flooding along a street (North Carolina sample
132 dataset):
133 g.region raster=elev_lid792_1m -p
134 # water accumulation next to street dam
135 r.lake elev_lid792_1m coordinates=638759.3,220264.1 water_level=113.4 lake=flooding
136 # draw resulting lake map over shaded terrain map
137 r.relief input=elev_lid792_1m output=elev_lid792_1m_shade
138 d.rast elev_lid792_1m_shade
139 d.rast flooding
140 d.vect streets_wake
141
142 Small flooding along a street (r.lake, using Lidar 1m DEM)
143
145 r.mapcalc, r.grow, r.plane
146
148 Maris Nartiss (maris.nartiss gmail.com)
149
150 Last changed: $Date: 2015-12-19 23:27:42 +0100 (Sat, 19 Dec 2015) $
151
153 Available at: r.lake source code (history)
154
155 Main index | Raster index | Topics index | Keywords index | Graphical
156 index | Full index
157
158 © 2003-2019 GRASS Development Team, GRASS GIS 7.4.4 Reference Manual
159
160
161
162GRASS 7.4.4 r.lake(1)