xdem.DEM.get_terrain_attribute

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:

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)]]