xdem.DEM.get_terrain_attribute#
- DEM.get_terrain_attribute(attribute, **kwargs)[source]#
Derive one or multiple terrain attributes from a DEM. The attributes are based on:
Slope, aspect, hillshade (first method) from Horn (1981), http://dx.doi.org/10.1109/PROC.1981.11918,
- Slope, aspect, hillshade (second method), and terrain curvatures from Zevenbergen and Thorne (1987),
Topographic Position Index from Weiss (2001), http://www.jennessent.com/downloads/TPI-poster-TNC_18x22.pdf.
- Terrain Ruggedness Index (topography) from Riley et al. (1999),
http://download.osgeo.org/qgis/doc/reference-docs/Terrain_Ruggedness_Index.pdf.
Terrain Ruggedness Index (bathymetry) from Wilson et al. (2007), http://dx.doi.org/10.1080/01490410701295962.
Roughness from Dartnell (2000), thesis referenced in Wilson et al. (2007) above.
Rugosity from Jenness (2004), https://doi.org/10.2193/0091-7648(2004)032[0829:CLSAFD]2.0.CO;2.
Fractal roughness from Taud et Parrot (2005), https://doi.org/10.4000/geomorphologie.622.
Aspect and hillshade are derived using the slope, and thus depend on the same method. More details on the equations in the functions get_quadric_coefficients() and get_windowed_indexes().
Attributes:
‘slope’: The slope in degrees or radians (degs: 0=flat, 90=vertical). Default method: “Horn”.
‘aspect’: The slope aspect in degrees or radians (degs: 0=N, 90=E, 180=S, 270=W).
‘hillshade’: The shaded slope in relation to its aspect.
‘curvature’: The second derivative of elevation (the rate of slope change per pixel), multiplied by 100.
‘planform_curvature’: The curvature perpendicular to the direction of the slope, multiplied by 100.
‘profile_curvature’: The curvature parallel to the direction of the slope, multiplied by 100.
‘maximum_curvature’: The maximum curvature.
‘surface_fit’: A quadric surface fit for each individual pixel.
- ‘topographic_position_index’: The topographic position index defined by a difference to the average of
neighbouring pixels.
- ‘terrain_ruggedness_index’: The terrain ruggedness index. For topography, defined by the squareroot of squared
differences to neighbouring pixels. For bathymetry, defined by the mean absolute difference to neighbouring pixels. Default method: “Riley” (topography).
‘roughness’: The roughness, i.e. maximum difference between neighbouring pixels.
‘rugosity’: The rugosity, i.e. difference between real and planimetric surface area.
‘fractal_roughness’: The roughness based on a volume box-counting estimate of the fractal dimension.
- Parameters:
attribute (
str
|list
[str
]) – The terrain attribute(s) to calculate.degrees – Convert radians to degrees?
hillshade_altitude – The shading altitude in degrees (0-90°). 90° is straight from above.
hillshade_azimuth – The shading azimuth in degrees (0-360°) going clockwise, starting from north.
hillshade_z_factor – Vertical exaggeration factor.
slope_method – Method to calculate the slope, aspect and hillshade: “Horn” or “ZevenbergThorne”.
tri_method – Method to calculate the Terrain Ruggedness Index: “Riley” (topography) or “Wilson” (bathymetry).
fill_method – See the ‘get_quadric_coefficients()’ docstring for information.
edge_method – See the ‘get_quadric_coefficients()’ docstring for information.
window_size – The window size for windowed ruggedness and roughness indexes.
- Raises:
ValueError – If the inputs are poorly formatted or are invalid.
- Return type:
Union
[TypeVar
(RasterType
, bound= Raster),list
[TypeVar
(RasterType
, bound= Raster)]]