sertit.rasters_rio.hillshade

hillshade(dst: Union[str, tuple, rasterio.io.DatasetReader], azimuth: float = 315, zenith: float = 45) -> (<class 'numpy.ma.core.MaskedArray'>, <class 'dict'>)[source]

Compute the hillshade of a DEM from an azimuth and elevation angle (in degrees).

Goal: replace gdaldem CLI (https://gdal.org/programs/gdaldem.html)

NB: altitude = 90 - zenith

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
  • dst (PATH_ARR_DS) – Path to the raster, its dataset, its xarray or a tuple containing its array and metadata

  • azimuth (float) – Azimuth angle in degrees

  • zenith (float) – Zenith angle in degrees

Returns

Hillshade and its metadata

Return type

(np.ma.masked_array, dict)