.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "GDALDEM" "1" "Apr 02, 2024" "" "GDAL" .SH NAME gdaldem \- Tools to analyze and visualize DEMs. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gdaldem [\-\-help] [\-\-help\-general] .ft P .fi .UNINDENT .UNINDENT .sp Generate a shaded relief map from any GDAL\-supported elevation raster: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gdaldem hillshade [\-z ] [\-s ] [\-az ] [\-alt ] [\-alg ZevenbergenThorne] [\-combined | \-multidirectional | \-igor] [\-compute_edges] [\-b ] [\-of ] [\-co =]... [\-q] .ft P .fi .UNINDENT .UNINDENT .sp Generate a slope map from any GDAL\-supported elevation raster: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gdaldem slope [\-p] [\-s ] [\-alg ZevenbergenThorne] [\-compute_edges] [\-b ] [\-of ] [\-co =]... [\-q] .ft P .fi .UNINDENT .UNINDENT .sp Generate an aspect map from any GDAL\-supported elevation raster, outputs a 32\-bit float raster with pixel values from 0\-360 indicating azimuth: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gdaldem aspect [\-trigonometric] [\-zero_for_flat] [\-alg ZevenbergenThorne] [\-compute_edges] [\-b ] [\-of format] [\-co =]... [\-q] .ft P .fi .UNINDENT .UNINDENT .sp Generate a color relief map from any GDAL\-supported elevation raster: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gdaldem color\-relief [\-alpha] [\-exact_color_entry | \-nearest_color_entry] [\-b ] [\-of format] [\-co =]... [\-q] where color_text_file contains lines of the format \(dqelevation_value red green blue\(dq .ft P .fi .UNINDENT .UNINDENT .sp Generate a Terrain Ruggedness Index (TRI) map from any GDAL\-supported elevation raster: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gdaldem TRI input_dem output_TRI_map [\-alg Wilson|Riley] [\-compute_edges] [\-b Band (default=1)] [\-of format] [\-q] .ft P .fi .UNINDENT .UNINDENT .sp Generate a Topographic Position Index (TPI) map from any GDAL\-supported elevation raster: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gdaldem TPI [\-compute_edges] [\-b ] [\-of ] [\-co =]... [\-q] .ft P .fi .UNINDENT .UNINDENT .sp Generate a roughness map from any GDAL\-supported elevation raster: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gdaldem roughness [\-compute_edges] [\-b ] [\-of ] [\-co =]... [\-q] .ft P .fi .UNINDENT .UNINDENT .SH DESCRIPTION .sp The \fBgdaldem\fP generally assumes that x, y and z units are identical. If x (east\-west) and y (north\-south) units are identical, but z (elevation) units are different, the scale (\-s) option can be used to set the ratio of vertical units to horizontal. For LatLong projections near the equator, where units of latitude and units of longitude are similar, elevation (z) units can be converted to be compatible by using scale=370400 (if elevation is in feet) or scale=111120 (if elevation is in meters). For locations not near the equator, it would be best to reproject your grid using gdalwarp before using gdaldem. .INDENT 0.0 .TP .B Where is one of the seven available modes: .INDENT 7.0 .IP \(bu 2 \fBhillshade\fP .INDENT 2.0 .INDENT 3.5 Generate a shaded relief map from any GDAL\-supported elevation raster. .UNINDENT .UNINDENT .IP \(bu 2 \fBslope\fP .INDENT 2.0 .INDENT 3.5 Generate a slope map from any GDAL\-supported elevation raster. .UNINDENT .UNINDENT .IP \(bu 2 \fBaspect\fP .INDENT 2.0 .INDENT 3.5 Generate an aspect map from any GDAL\-supported elevation raster. .UNINDENT .UNINDENT .IP \(bu 2 \fBcolor\-relief\fP .INDENT 2.0 .INDENT 3.5 Generate a color relief map from any GDAL\-supported elevation raster. .UNINDENT .UNINDENT .IP \(bu 2 \fBTRI\fP .INDENT 2.0 .INDENT 3.5 Generate a map of Terrain Ruggedness Index from any GDAL\-supported elevation raster. .UNINDENT .UNINDENT .IP \(bu 2 \fBTPI\fP .INDENT 2.0 .INDENT 3.5 Generate a map of Topographic Position Index from any GDAL\-supported elevation raster. .UNINDENT .UNINDENT .IP \(bu 2 \fBroughness\fP .INDENT 2.0 .INDENT 3.5 Generate a map of roughness from any GDAL\-supported elevation raster. .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp The following general options are available: .INDENT 0.0 .TP .B \-\-help Show this help message and exit .UNINDENT .INDENT 0.0 .TP .B \-\-help\-general Gives a brief usage message for the generic GDAL commandline options and exit. .UNINDENT .INDENT 0.0 .TP .B The input DEM raster to be processed .UNINDENT .INDENT 0.0 .TP .B The output raster produced .UNINDENT .INDENT 0.0 .TP .B \-of Select the output format. .sp New in version 2.3.0: If not specified, the format is guessed from the extension (previously was \fI\%GTiff \-\- GeoTIFF File Format\fP). Use the short format name. .UNINDENT .INDENT 0.0 .TP .B \-compute_edges Do the computation at raster edges and near nodata values .UNINDENT .INDENT 0.0 .TP .B \-b Select an input band to be processed. Bands are numbered from 1. .UNINDENT .INDENT 0.0 .TP .B \-co = Many formats have one or more optional creation options that can be used to control particulars about the file created. For instance, the GeoTIFF driver supports creation options to control compression, and whether the file should be tiled. .sp The creation options available vary by format driver, and some simple formats have no creation options at all. A list of options supported for a format can be listed with the \fI\%\-\-formats\fP command line option but the documentation for the format is the definitive source of information on driver creation options. See \fI\%Raster drivers\fP format specific documentation for legal creation options for each format. .UNINDENT .INDENT 0.0 .TP .B \-q Suppress progress monitor and other non\-error output. .UNINDENT .sp For all algorithms, except color\-relief, a nodata value in the target dataset will be emitted if at least one pixel set to the nodata value is found in the 3x3 window centered around each source pixel. The consequence is that there will be a 1\-pixel border around each image set with nodata value. .INDENT 0.0 .INDENT 3.5 If \fI\%\-compute_edges\fP is specified, gdaldem will compute values at image edges or if a nodata value is found in the 3x3 window, by interpolating missing values. .UNINDENT .UNINDENT .SH MODES .SS hillshade .sp This command outputs an 8\-bit raster with a nice shaded relief effect. It’s very useful for visualizing the terrain. You can optionally specify the azimuth and altitude of the light source, a vertical exaggeration factor and a scaling factor to account for differences between vertical and horizontal units. .sp The value 0 is used as the output nodata value. .sp The following specific options are available : .INDENT 0.0 .TP .B \-alg Horn|ZevenbergenThorne The literature suggests Zevenbergen & Thorne to be more suited to smooth landscapes, whereas Horn\(aqs formula to perform better on rougher terrain. .UNINDENT .INDENT 0.0 .TP .B \-z Vertical exaggeration used to pre\-multiply the elevations .UNINDENT .INDENT 0.0 .TP .B \-s Ratio of vertical units to horizontal. If the horizontal unit of the source DEM is degrees (e.g Lat/Long WGS84 projection), you can use scale=111120 if the vertical units are meters (or scale=370400 if they are in feet) .UNINDENT .INDENT 0.0 .TP .B \-az Azimuth of the light, in degrees. 0 if it comes from the top of the raster, 90 from the east, ... The default value, 315, should rarely be changed as it is the value generally used to generate shaded maps. .UNINDENT .INDENT 0.0 .TP .B \-alt Altitude of the light, in degrees. 90 if the light comes from above the DEM, 0 if it is raking light. .UNINDENT .INDENT 0.0 .TP .B \-combined combined shading, a combination of slope and oblique shading. .UNINDENT .INDENT 0.0 .TP .B \-multidirectional multidirectional shading, a combination of hillshading illuminated from 225 deg, 270 deg, 315 deg, and 360 deg azimuth. .sp New in version 2.2. .UNINDENT .INDENT 0.0 .TP .B \-igor shading which tries to minimize effects on other map features beneath. Can\(aqt be used with \-alt option. .sp New in version 3.0. .UNINDENT .sp Multidirectional hillshading applies the formula of \fI\%http://pubs.usgs.gov/of/1992/of92\-422/of92\-422.pdf\fP\&. .sp Igor\(aqs hillshading uses formula from Maperitive \fI\%http://maperitive.net/docs/Commands/GenerateReliefImageIgor.html\fP\&. .SS slope .sp This command will take a DEM raster and output a 32\-bit float raster with slope values. You have the option of specifying the type of slope value you want: degrees or percent slope. In cases where the horizontal units differ from the vertical units, you can also supply a scaling factor. .sp The value \fI\-9999\fP is used as the output nodata value. .sp The following specific options are available : .INDENT 0.0 .TP .B \-alg Horn|ZevenbergenThorne The literature suggests Zevenbergen & Thorne to be more suited to smooth landscapes, whereas Horn\(aqs formula to perform better on rougher terrain. .UNINDENT .INDENT 0.0 .TP .B \-p If specified, the slope will be expressed as percent slope. Otherwise, it is expressed as degrees .UNINDENT .sp \fI\%\-s\fP .INDENT 0.0 .INDENT 3.5 Ratio of vertical units to horizontal. If the horizontal unit of the source DEM is degrees (e.g Lat/Long WGS84 projection), you can use scale=111120 if the vertical units are meters (or scale=370400 if they are in feet). .UNINDENT .UNINDENT .SS aspect .sp This command outputs a 32\-bit float raster with values between 0° and 360° representing the azimuth that slopes are facing. The definition of the azimuth is such that : 0° means that the slope is facing the North, 90° it\(aqs facing the East, 180° it\(aqs facing the South and 270° it\(aqs facing the West (provided that the top of your input raster is north oriented). The aspect value \-9999 is used as the nodata value to indicate undefined aspect in flat areas with slope=0. .sp The following specifics options are available : .INDENT 0.0 .TP .B \-alg Horn|ZevenbergenThorne The literature suggests Zevenbergen & Thorne to be more suited to smooth landscapes, whereas Horn\(aqs formula to perform better on rougher terrain. .UNINDENT .INDENT 0.0 .TP .B \-trigonometric Return trigonometric angle instead of azimuth. Thus 0° means East, 90° North, 180° West, 270° South. .UNINDENT .INDENT 0.0 .TP .B \-zero_for_flat Return 0 for flat areas with slope=0, instead of \-9999. .UNINDENT .sp By using those 2 options, the aspect returned by gdaldem aspect should be identical to the one of GRASS r.slope.aspect. Otherwise, it\(aqs identical to the one of Matthew Perry\(aqs \fBaspect.cpp\fP utility. .SS color\-relief .sp This command outputs a 3\-band (RGB) or 4\-band (RGBA) raster with values are computed from the elevation and a text\-based color configuration file, containing the association between various elevation values and the corresponding wished color. By default, the colors between the given elevation values are blended smoothly and the result is a nice colorized DEM. The \-exact_color_entry or \-nearest_color_entry options can be used to avoid that linear interpolation for values that don\(aqt match an index of the color configuration file. .sp The following specifics options are available : .INDENT 0.0 .TP .B color_text_file Text\-based color configuration file .UNINDENT .INDENT 0.0 .TP .B \-alpha Add an alpha channel to the output raster .UNINDENT .INDENT 0.0 .TP .B \-exact_color_entry Use strict matching when searching in the color configuration file. If none matching color entry is found, the \(dq0,0,0,0\(dq RGBA quadruplet will be used .UNINDENT .INDENT 0.0 .TP .B \-nearest_color_entry Use the RGBA quadruplet corresponding to the closest entry in the color configuration file. .UNINDENT .sp The color\-relief mode is the only mode that supports VRT as output format. In that case, it will translate the color configuration file into appropriate LUT elements. Note that elevations specified as percentage will be translated as absolute values, which must be taken into account when the statistics of the source raster differ from the one that was used when building the VRT. .sp The text\-based color configuration file generally contains 4 columns per line: the elevation value and the corresponding Red, Green, Blue component (between 0 and 255). The elevation value can be any floating point value, or the nv keyword for the nodata value. The elevation can also be expressed as a percentage: 0% being the minimum value found in the raster, 100% the maximum value. .sp An extra column can be optionally added for the alpha component. If it is not specified, full opacity (255) is assumed. .sp Various field separators are accepted: comma, tabulation, spaces, \(aq:\(aq. .sp Common colors used by GRASS can also be specified by using their name, instead of the RGB triplet. The supported list is: white, black, red, green, blue, yellow, magenta, cyan, aqua, grey/gray, orange, brown, purple/violet and indigo. .INDENT 0.0 .INDENT 3.5 GMT \fB\&.cpt\fP palette files are also supported (COLOR_MODEL = RGB only). .UNINDENT .UNINDENT .sp Note: the syntax of the color configuration file is derived from the one supported by GRASS r.colors utility. ESRI HDR color table files (.clr) also match that syntax. The alpha component and the support of tab and comma as separators are GDAL specific extensions. .sp For example: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C 3500 white 2500 235:220:175 50% 190 185 135 700 240 250 150 0 50 180 50 nv 0 0 0 0 .ft P .fi .UNINDENT .UNINDENT .sp To implement a \(dqround to the floor value\(dq mode, the elevation value can be duplicate with a new value being slightly above the threshold. For example to have red in [0,10], green in ]10,20] and blue in ]20,30]: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C 0 red 10 red 10.001 green 20 green 20.001 blue 30 blue .ft P .fi .UNINDENT .UNINDENT .SS TRI .sp This command outputs a single\-band raster with values computed from the elevation. \fITRI\fP stands for Terrain Ruggedness Index, which measures the difference between a central pixel and its surrounding cells. .sp The value \-9999 is used as the output nodata value. .sp The following option is available: .INDENT 0.0 .TP .B \-alg Wilson|Riley Starting with GDAL 3.3, the Riley algorithm (see Riley, S.J., De Gloria, S.D., Elliot, R. (1999): A Terrain Ruggedness that Quantifies Topographic Heterogeneity. Intermountain Journal of Science, Vol.5, No.1\-4, pp.23\-27) is available and the new default value. This algorithm uses the square root of the sum of the square of the difference between a central pixel and its surrounding cells. This is recommended for terrestrial use cases. .sp The Wilson (see Wilson et al 2007, Marine Geodesy 30:3\-35) algorithm uses the mean difference between a central pixel and its surrounding cells. This is recommended for bathymetric use cases. .UNINDENT .SS TPI .sp This command outputs a single\-band raster with values computed from the elevation. \fITPI\fP stands for Topographic Position Index, which is defined as the difference between a central pixel and the mean of its surrounding cells (see Wilson et al 2007, Marine Geodesy 30:3\-35). .sp The value \-9999 is used as the output nodata value. .sp There are no specific options. .SS roughness .sp This command outputs a single\-band raster with values computed from the elevation. Roughness is the largest inter\-cell difference of a central pixel and its surrounding cell, as defined in Wilson et al (2007, Marine Geodesy 30:3\-35). .sp The value \-9999 is used as the output nodata value. .sp There are no specific options. .SH C API .sp This utility is also callable from C with \fI\%GDALDEMProcessing()\fP\&. .sp New in version 2.1. .SH AUTHORS .sp Matthew Perry \fI\%perrygeo@gmail.com\fP, Even Rouault \fI\%even.rouault@spatialys.com\fP, Howard Butler \fI\%hobu.inc@gmail.com\fP, Chris Yesson \fI\%chris.yesson@ioz.ac.uk\fP .sp Derived from code by Michael Shapiro, Olga Waupotitsch, Marjorie Larson, Jim Westervelt: U.S. Army CERL, 1993. GRASS 4.1 Reference Manual. U.S. Army Corps of Engineers, Construction Engineering Research Laboratories, Champaign, Illinois, 1\-425. .SH SEE ALSO .sp Documentation of related GRASS utilities: .sp \fI\%https://grass.osgeo.org/grass79/manuals/r.slope.aspect.html\fP .sp \fI\%https://grass.osgeo.org/grass79/manuals/r.relief.html\fP .sp \fI\%https://grass.osgeo.org/grass79/manuals/r.colors.html\fP .SH AUTHOR Matthew Perry , Even Rouault , Howard Butler , Chris Yesson .SH COPYRIGHT 1998-2024 .\" Generated by docutils manpage writer. .