sertit.rasters_rio.slope¶
- slope(dst: Union[str, tuple, rasterio.io.DatasetReader], in_pct: bool = False, in_rad: bool = False) -> (<class 'numpy.ma.core.MaskedArray'>, <class 'dict'>)[source]¶
Compute the slope of a DEM (in degrees).
Goal: replace gdaldem CLI (https://gdal.org/programs/gdaldem.html)
Warning
It uses a 2nd order gradient instead of Horn’s or Zevenbergen & Thorne’s formula
z_factor is fixed to 1.0
scale managed by dst resolution
Reference: - https://git.earthdata.nasa.gov/projects/GEE/repos/gdal-enhancements-for-esdis/browse/gdal-1.10.0/apps/gdaldem.cpp
- Parameters
- Returns
Slope and its metadata
- Return type
(np.ma.masked_array, dict)