r.relief(1)
π r.relief β the glow-up your elevation map has been waiting for
okay bestie, so this is r.relief, a GRASS GIS module (that's r.relief(1) in the manual, section 1, GRASS GIS User's Manual) and it literally makes a shaded relief map out of an elevation map (a DEM). It's giving instant contour couture. β¨
π·οΈ NAME
r.relief β creates shaded relief map from an elevation map (DEM).
π KEYWORDS
raster, elevation, relief, terrain, hillshade
π SYNOPSIS
r.relief
r.relief --help
r.relief input=name output=name [altitude=float] [azimuth=float]
[zscale=float] [scale=float] [units=string] [--overwrite]
[--help] [--verbose] [--quiet] [--ui]
π© Flags
--overwriteβ allow output files to overwrite existing files (no "oops I already had a file there" energy, it just goes for it π)--helpβ print usage summary--verboseβ verbose module output (it will yap π£οΈ)--quietβ quiet module output (not a single peep π€«)--uiβ force launching GUI dialog
ποΈ Parameters
input=name[required]β name of input raster (typically elevation) mapoutput=name[required]β name for output shaded relief mapaltitude=floatβ altitude of the sun in degrees above the horizon- Options:
0-90 - Default:
30
- Options:
azimuth=floatβ azimuth of the sun in degrees to the east of north- Options:
0-360 - Default:
270
- Options:
zscale=floatβ factor for exaggerating relief- Default:
1
- Default:
scale=floatβ scale factor for converting meters to elevation units- Default:
1
- Default:
units=stringβ elevation units (overrides scale factor)- Options:
intl,survey intl: international feetsurvey: survey feet
- Options:
π DESCRIPTION
So r.relief creates a raster shaded relief map based on the current resolution settings and on the sun altitude, azimuth, and z-exaggeration values that you, the user, enter. Basically you're the sun now. Main character energy, honestly. βοΈπ
The parameters controlling the shading are, in order:
- An input raster map to provide elevation values for the shaded relief map. Typically, this would be a map layer of elevation; however, any raster map layer can be named. (fr fr, ANY raster map. we don't gatekeep.)
- The altitude of the sun in degrees above the horizon (a value between 0 and 90 degrees).
- The azimuth of the sun in degrees to the east of north (a value between 0 and 360 degrees; clockwise from north).
- The scaling parameter, which compensates for a different horizontal scale than vertical scale. If
scaleis a number, then theewresandnsresare multiplied by that scale to calculate the shading. (Default=1.0for equivalent horizontal and vertical scales.) - The
zscaleexaggeration factor that changes the apparent relief for the shaded relief map. This can be any positive (or negative) floating point value. (default=1.0) - Horizontal distances are calculated in meters, using geodesic distances for a latitude-longitude projection. With an elevation map measured in feet, the
unitsoption can be set to automatically convert meters to international feet (0.3048meters =1foot) or survey feet (1200 / 3937meters =1foot). Theunitsparameter overrides thescaleparameter.
And then r.relief assigns a grey-scale color table to the new shaded relief map. periodt. π©Ά
π NOTES
To visually improve the result of shade maps from low resolution elevation models, use r.resamp.interp with bilinear or bicubic method to resample the DEM at higher resolution. r.relief is then run on the resampled DEM. glowed-up DEM first, then shade. the way that works?? iconic. β¨
β οΈ The current mask is ignored. not "respected but overridden", not "partially applied" β ignored. bestie the mask is NOT invited to this one.
π§ͺ EXAMPLES
π Shaded relief map
In this example, the aspect map in the North Carolina sample dataset is used to hillshade the elevation map:
g.region raster=elevation -p
r.relief input=elevation output=elevation_shade
(figure caption: r.relief: shaded elevation map (subset))
π¨ Colorizing a shaded relief map
Color can be added later using r.shade or d.shade:
r.shade shade=elevation_shade color=elevation output=elevation_shaded
π Using the scale factor in Latitude-Longitude
In Latitude-Longitude coordinate reference systems (or other non-metric systems), the scale factor has to be used:
# Latitude-Longitude example
g.region raster=srtm -p
r.relief input=srtm output=srtm_shaded scale=111120
π¦ Exporting shaded relief maps to GeoTIFF
The data range of shaded relief maps usually does not permit exporting the map to GeoTIFF format along with its associated color table due to limitations in the GeoTIFF format. (the GeoTIFF format said "no β€οΈ" to your color table.)
The most simple way to export it while even reducing the file size is to export as palette byte map. This requires a conversion done in r.mapcalc, using the # operator to convert map category values to their grey scale equivalents:
# using the map created above
# create new map from map category values
r.mapcalc expression="elevation_shade_byte = #elevation_shade"
# verify data range
r.info elevation_shade_byte
# assign grey color table
r.colors elevation_shade_byte color=grey
# export (optionally: createopt="COMPRESS=DEFLATE,BIGTIFF=YES")
r.out.gdal input=elevation_shade_byte createopt="COMPRESS=DEFLATE" \
output=elevation_shade.tif
# add overview images in GeoTIFF file for faster zooming
gdaladdo --config GDAL_CACHEMAX 2000 elevation_shade.tif 2 4 8 16
π SEE ALSO
d.shade, d.his, g.region, r.shade, r.blend, r.colors, r.mapcalc, r.resamp.interp
βοΈ AUTHORS
- Jim Westervelt, U.S. Army Construction Engineering Research Laboratory
- Markus Metz: Enhanced fast C version of
r.relieffor GRASS GIS 7
πΎ SOURCE CODE
Available at: r.relief source code (history)
Accessed: Saturday Jan 17 05:40:59 2026
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
okay that's the whole thing, no cap π«Ά this page lives in the GRASS GIS 8.4.2 Reference Manual, it's Β© 2003-2025 GRASS Development Team, and the version stamped at the bottom is GRASS 8.4.2 with the page id r.relief(1). go shade something gorgeous, bestie ππ¦
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms