xdem.DEM.hillshade#
- DEM.hillshade(method='Horn', azimuth=315.0, altitude=45.0, z_factor=1.0, use_richdem=False)[source]#
Generate a hillshade from the given DEM. The value 0 is used for nodata, and 1 to 255 for hillshading.
Based on Horn (1981), http://dx.doi.org/10.1109/PROC.1981.11918.
- Parameters:
method (
str
) – Method to calculate the slope and aspect used for hillshading.azimuth (
float
) – The shading azimuth in degrees (0-360°) going clockwise, starting from north.altitude (
float
) – The shading altitude in degrees (0-90°). 90° is straight from above.z_factor (
float
) – Vertical exaggeration factor.use_richdem (
bool
) – Whether to use RichDEM to compute the slope and aspect used for the hillshade.
- Raises:
AssertionError – If the given DEM is not a 2D array.
ValueError – If invalid argument types or ranges were given.
- Return type:
TypeVar
(RasterType
, bound= Raster)- Returns:
A hillshade with the dtype “float32” with value ranges of 0-255.