1r.relief(1) GRASS GIS User's Manual r.relief(1)
2
3
4
6 r.relief - Creates shaded relief map from an elevation map (DEM).
7
9 raster, elevation, relief, terrain, hillshade
10
12 r.relief
13 r.relief --help
14 r.relief input=name output=name [altitude=float] [azimuth=float]
15 [zscale=float] [scale=float] [units=string] [--overwrite]
16 [--help] [--verbose] [--quiet] [--ui]
17
18 Flags:
19 --overwrite
20 Allow output files to overwrite existing files
21
22 --help
23 Print usage summary
24
25 --verbose
26 Verbose module output
27
28 --quiet
29 Quiet module output
30
31 --ui
32 Force launching GUI dialog
33
34 Parameters:
35 input=name [required]
36 Name of input raster (typically elevation) map
37
38 output=name [required]
39 Name for output shaded relief map
40
41 altitude=float
42 Altitude of the sun in degrees above the horizon
43 Options: 0-90
44 Default: 30
45
46 azimuth=float
47 Azimuth of the sun in degrees to the east of north
48 Options: 0-360
49 Default: 270
50
51 zscale=float
52 Factor for exaggerating relief
53 Default: 1
54
55 scale=float
56 Scale factor for converting meters to elevation units
57 Default: 1
58
59 units=string
60 Elevation units (overrides scale factor)
61 Options: intl, survey
62 intl: international feet
63 survey: survey feet
64
66 r.relief creates a raster shaded relief map based on current resolution
67 settings and on sun altitude, azimuth, and z-exaggeration values
68 entered by the user.
69
70 The parameters controlling the shading are:
71
72 1 An input raster map to provide elevation values for the shaded
73 relief map. Typically, this would be a map layer of elevation;
74 however, any raster map layer can be named.
75
76 2 The altitude of the sun in degrees above the horizon (a value
77 between 0 and 90 degrees).
78
79 3 The azimuth of the sun in degrees to the east of north (a value
80 between 0 and 360 degrees; clockwise from north)
81
82 4 The scaling parameter, which compensates for a different hori‐
83 zontal scale than vertical scale. If scale is a number, then the
84 ewres and nsres are multiplied by that scale to calculate the
85 shading. (Default=1.0 for equivalent horizontal and vertical
86 scales.)
87
88 5 The zscale exaggeration factor that changes the apparent relief
89 for the shaded relief map. This can be any positive (or nega‐
90 tive) floating point value. (Default=1.0)
91
92 6 Horizontal distances are calculated in meters, using geodesic
93 distances for a latitude-longitude projection. With an elevation
94 map measured in feet, the units option can be set to automati‐
95 cally convert meters to international feet (0.3048 meters = 1
96 foot) or survey feet (1200 / 3937 meters = 1 foot). The units
97 parameter overrides the scale parameter.
98
99 r.relief assigns a grey-scale color table to the new shaded relief map.
100
102 To visually improve the result of shade maps from low resolution eleva‐
103 tion models, use r.resamp.interp with bilinear or bicubic method to
104 resample the DEM at higher resolution. r.relief is then run on the
105 resampled DEM.
106
107 The current mask is ignored.
108
110 Shaded relief map
111 In this example, the aspect map in the North Carolina sample dataset
112 location is used to hillshade the elevation map:
113 g.region raster=elevation -p
114 r.relief input=elevation output=elevation_shade
115 r.relief: shaded elevation map (subset)
116
117 Colorizing a shaded relief map
118 Color can be added later using r.shade or d.shade:
119 r.shade shade=elevation_shade color=elevation output=elevation_shaded
120
121 Using the scale factor in Latitude-Longitude
122 In Latitude-Longitude locations (or other non-metric locations), the
123 scale factor has to be used:
124 # Latitude-Longitude example
125 g.region raster=srtm -p
126 r.relief input=srtm output=srtm_shaded scale=111120
127
128 Exporting shaded relief maps to GeoTIFF
129 The data range of shaded relief maps usually does not permit exporting
130 the map to GeoTIFF format along with its associated color table due to
131 limitations in the GeoTIFF format.
132
133 The most simple way to export it while even reducing the file size is
134 to export as palette byte map. This requires a conversion done in
135 r.mapcalc, using the # operator to convert map category values to their
136 grey scale equivalents:
137 # using the map created above
138 # create new map from map category values
139 r.mapcalc expression="elevation_shade_byte = #elevation_shade"
140 # verify data range
141 r.info elevation_shade_byte
142 # assign grey color table
143 r.colors elevation_shade_byte color=grey
144 # export (optionally: createopt="COMPRESS=DEFLATE,BIGTIFF=YES")
145 r.out.gdal input=elevation_shade_byte createopt="COMPRESS=DEFLATE" \
146 output=elevation_shade.tif
147 # add overview images in GeoTIFF file for faster zooming
148 gdaladdo --config GDAL_CACHEMAX 2000 elevation_shade.tif 2 4 8 16
149
151 d.shade, d.his, g.region, r.shade, r.blend, r.colors, r.mapcalc,
152 r.resamp.interp
153
155 Jim Westervelt, U.S. Army Construction Engineering Research Laboratory
156 Markus Metz: Enhanced fast C version of r.relief for GRASS GIS 7
157
159 Available at: r.relief source code (history)
160
161 Main index | Raster index | Topics index | Keywords index | Graphical
162 index | Full index
163
164 © 2003-2020 GRASS Development Team, GRASS GIS 7.8.5 Reference Manual
165
166
167
168GRASS 7.8.5 r.relief(1)