1gdaldem(1) General Commands Manual gdaldem(1)
2
3
4
6 gdaldem - .TH "gdaldem" 1 "Fri Apr 22 2011" "GDAL"
7
9 gdaldem - Tools to analyze and visualize DEMs. (since GDAL 1.7.0)
10
12 - To generate a shaded relief map from any GDAL-supported elevation raster :
13 gdaldem hillshade input_dem output_hillshade
14 [-z ZFactor (default=1)] [-s scale* (default=1)]"
15 [-az Azimuth (default=315)] [-alt Altitude (default=45)]
16 [-b Band (default=1)] [-of format] [-co "NAME=VALUE"]* [-q]
17
18 - To generate a slope map from any GDAL-supported elevation raster :
19 gdaldem slope input_dem output_slope_map"
20 [-p use percent slope (default=degrees)] [-s scale* (default=1)]
21 [-b Band (default=1)] [-of format] [-co "NAME=VALUE"]* [-q]
22
23 - To generate an aspect map from any GDAL-supported elevation raster
24 Outputs a 32-bit float raster with pixel values from 0-360 indicating azimuth :
25 gdaldem aspect input_dem output_aspect_map"
26 [-trigonometric] [-zero_for_flat]
27 [-b Band (default=1)] [-of format] [-co "NAME=VALUE"]* [-q]
28
29 - To generate a color relief map from any GDAL-supported elevation raster
30 gdaldem color-relief input_dem color_text_file output_color_relief_map
31 [-alpha] [-exact_color_entry | -nearest_color_entry]
32 [-b Band (default=1)] [-of format] [-co "NAME=VALUE"]* [-q]
33 where color_text_file contains lines of the format "elevation_value red green blue"
34
35 - To generate a Terrain Ruggedness Index (TRI) map from any GDAL-supported elevation raster:
36 gdaldem TRI input_dem output_TRI_map
37 [-b Band (default=1)] [-of format] [-q]
38
39 - To generate a Topographic Position Index (TPI) map from any GDAL-supported elevation raster:
40 gdaldem TPI input_dem output_TPI_map
41 [-b Band (default=1)] [-of format] [-q]
42
43 - To generate a roughness map from any GDAL-supported elevation raster:
44 gdaldem roughness input_dem output_roughness_map
45 [-b Band (default=1)] [-of format] [-q]
46
47 Notes :
48 Scale is the ratio of vertical units to horizontal
49 for Feet:Latlong use scale=370400, for Meters:LatLong use scale=111120)
50
51
53 This utility has 7 different modes :
54
55 hillshade
56 to generate a shaded relief map from any GDAL-supported elevation
57 raster
58
59 slope
60 to generate a slope map from any GDAL-supported elevation raster
61
62 aspect
63 to generate an aspect map from any GDAL-supported elevation raster
64
65 color-relief
66 to generate a color relief map from any GDAL-supported elevation
67 raster
68
69 TRI
70 to generate a map of Terrain Ruggedness Index from any GDAL-
71 supported elevation raster
72
73 TPI
74 to generate a map of Topographic Position Index from any GDAL-
75 supported elevation raster
76
77 roughness
78 to generate a map of roughness from any GDAL-supported elevation
79 raster
80
81 The following general options are available :
82
83 input_dem:
84 The input DEM raster to be processed
85
86 output_xxx_map:
87 The output raster produced
88
89 -of format:
90 Select the output format. The default is GeoTIFF (GTiff). Use the
91 short format name.
92
93 -b band:
94 Select an input band to be processed. Bands are numbered from 1.
95
96 -co 'NAME=VALUE':
97 Passes a creation option to the output format driver. Multiple -co
98 options may be listed. See format specific documentation for legal
99 creation options for each format.
100
101 -q:
102 Suppress progress monitor and other non-error output.
103
105 hillshade
106 This command outputs an 8-bit raster with a nice shaded relief effect.
107 It’s very useful for visualizing the terrain. You can optionally
108 specify the azimuth and altitude of the light source, a vertical
109 exaggeration factor and a scaling factor to account for differences
110 between vertical and horizontal units.
111
112 The following specific options are available :
113
114 -z zFactor:
115 vertical exaggeration used to pre-multiply the elevations
116
117 -s scale:
118 ratio of vertical units to horizontal. If the horizontal unit of
119 the source DEM is degrees (e.g Lat/Long WGS84 projection), you can
120 use scale=111120 if the vertical units are meters (or scale=370400
121 if they are in feet)
122
123 -az azimuth:
124 azimuth of the light, in degrees. 0 if it comes from the top of the
125 raster, 90 from the east, ... The default value, 315, should rarely
126 be changed as it is the value generally used to generate shaded
127 maps.
128
129 -alt altitude:
130 altitude of the light, in degrees. 90 if the light comes from above
131 the DEM, 0 if it is raking light.
132
133 slope
134 This command will take a DEM raster and output a 32-bit float raster
135 with slope values. You have the option of specifying the type of slope
136 value you want: degrees or percent slope. In cases where the horizontal
137 units differ from the vertical units, you can also supply a scaling
138 factor.
139
140 The following specific options are available :
141
142 -p :
143 if specified, the slope will be expressed as percent slope.
144 Otherwise, it is expressed as degrees
145
146 -s scale:
147 ratio of vertical units to horizontal. If the horizontal unit of
148 the source DEM is degrees (e.g Lat/Long WGS84 projection), you can
149 use scale=111120 if the vertical units are meters (or scale=370400
150 if they are in feet)
151
152 aspect
153 This command outputs a 32-bit float raster with values between 0° and
154 360° representing the azimuth that slopes are facing. The definition of
155 the azimuth is such that : 0° means that the slope is facing the North,
156 90° it's facing the East, 180° it's facing the South and 270° it's
157 facing the West (provided that the top of your input raster is north
158 oriented). The aspect value -9999 is used as the nodata value to
159 indicate undefined aspect in flat areas with slope=0.
160
161 The following specifics options are available :
162
163 -trigonometric:
164 return trigonometric angle instead of azimuth. Thus 0° means East,
165 90° North, 180° West, 270° South
166
167 -zero_for_flat:
168 return 0 for flat areas with slope=0, instead of -9999
169
170 By using those 2 options, the aspect returned by gdaldem aspect should
171 be identical to the one of GRASS r.slope.aspect. Otherwise, it's
172 identical to the one of Matthew Perry's aspect.cpp utility.
173
174 color-relief
175 This command outputs a 3-band (RGB) or 4-band (RGBA) raster with values
176 are computed from the elevation and a text-based color configuration
177 file, containing the association between various elevation values and
178 the corresponding wished color. By default, the colors between the
179 given elevation values are blended smoothly and the result is a nice
180 colorized DEM. The -exact_color_entry or -nearest_color_entry options
181 can be used to avoid that linear interpolation for values that don't
182 match an index of the color configuration file.
183
184 The following specifics options are available :
185
186 color_text_file:
187 text-based color configuration file
188
189 -alpha :
190 add an alpha channel to the output raster
191
192 -exact_color_entry :
193 use strict matching when searching in the color configuration file.
194 If none matching color entry is found, the '0,0,0,0' RGBA
195 quadruplet will be used
196
197 -nearest_color_entry :
198 use the RGBA quadruplet corresponding to the closest entry in the
199 color configuration file.
200
201 The color-relief mode is the only mode that supports VRT as output
202 format. In that case, it will translate the color configuration file
203 into appropriate <LUT> elements. Note that elevations specified as
204 percentage will be translated as absolute values, which must be taken
205 into account when the statistics of the source raster differ from the
206 one that was used when building the VRT.
207
208 The text-based color configuration file generally contains 4 columns
209 per line : the elevation value and the corresponding Red, Green, Blue
210 component (between 0 and 255). The elevation value can be any floating
211 point value, or the nv keyword for the nodata value.. The elevation can
212 also be expressed as a percentage : 0% being the minimum value found in
213 the raster, 100% the maximum value.
214
215 An extra column can be optionnaly added for the alpha component. If it
216 is not specified, full opacity (255) is assumed.
217
218 Various field separators are accepted : comma, tabulation, spaces, ':'.
219
220 Common colors used by GRASS can also be specified by using their name,
221 instead of the RGB triplet. The supported list is : white, black, red,
222 green, blue, yellow, magenta, cyan, aqua, grey/gray, orange, brown,
223 purple/violet and indigo.
224
225 Note: the syntax of the color configuration file is derived from the
226 one supported by GRASS r.colors utility. ESRI HDR color table files
227 (.clr) also match that syntax. The alpha component and the support of
228 tablulations and commma as separators are GDAL specific extensions.
229
230 For example :
231
232 3500 white
233 2500 235:220:175
234 50% 190 185 135
235 700 240 250 150
236 0 50 180 50
237 nv 0 0 0 0
238
239
240 TRI
241 This command outputs a single-band raster with values computed from the
242 elevation. TRI stands for Terrain Ruggedness Index, which is defined as
243 the mean difference between a central pixel and its surrounding cells
244 (see Wilson et al 2007, Marine Geodesy 30:3-35).
245
246 There are no specific options.
247
248 TPI
249 This command outputs a single-band raster with values computed from the
250 elevation. TPI stands for Topographic Position Index, which is defined
251 as the difference between a central pixel and the mean of its
252 surrounding cells (see Wilson et al 2007, Marine Geodesy 30:3-35).
253
254 There are no specific options.
255
256 roughness
257 This command outputs a single-band raster with values computed from the
258 elevation. Roughness is the the largest inter-cell difference of a
259 central pixel and its surrounding cell, as defined in Wilson et al
260 (2007, Marine Geodesy 30:3-35).
261
262 There are no specific options.
263
265 Matthew Perry <perrygeo@gmail.com>, Even Rouault <even.rouault@mines-
266 paris.org>, Howard Butler <hobu.inc@gmail.com>, Chris Yesson
267 <chris.yesson@ioz.ac.uk>
268
269 Derived from code by Michael Shapiro, Olga Waupotitsch, Marjorie
270 Larson, Jim Westervelt : U.S. Army CERL, 1993. GRASS 4.1 Reference
271 Manual. U.S. Army Corps of Engineers, Construction Engineering Research
272 Laboratories, Champaign, Illinois, 1-425.
273
275 Documentation of related GRASS utilities :
276
277 http://grass.osgeo.org/grass64/manuals/html64_user/r.slope.aspect.html
278
279 http://grass.osgeo.org/grass64/manuals/html64_user/r.shaded.relief.html
280
281 http://grass.osgeo.org/grass64/manuals/html64_user/r.colors.html
282
283
284
285GDAL Fri Apr 22 2011 gdaldem(1)