Class: QgsHillshadeRenderer¶
A renderer for generating live hillshade models.
Class Hierarchy¶
Base classes¶
Raster renderer pipe that applies colors to a raster. |
|
Base class for processing filters like renderers, reprojector, resampler etc. |
Methods
Returns the angle of the light source over the raster. |
|
Returns the direction of the light over the raster between 0-360. |
|
Returns the band used by the renderer |
|
Returns |
|
Set the altitude of the light source |
|
Set the azimuth of the light source. |
|
Sets the band used by the renderer. |
|
Sets whether to render using a multi-directional hillshade algorithm. |
|
Set the Z scaling factor of the result image. |
|
Returns the Z scaling factor. |
Static Methods
Factory method to create a new renderer |
- class qgis.core.QgsHillshadeRenderer[source]¶
Bases:
QgsRasterRenderer
- __init__(input: QgsRasterInterface | None, band: int, lightAzimuth: float, lightAltitude: float)
A renderer for generating live hillshade models.
- Parameters:
input (Optional[QgsRasterInterface]) – The input raster interface
band (int) – The band in the raster to use
lightAzimuth (float) – The azimuth of the light source
lightAltitude (float) – The altitude of the light source
- altitude(self) float [source]¶
Returns the angle of the light source over the raster.
See also
- Return type:
float
- azimuth(self) float [source]¶
Returns the direction of the light over the raster between 0-360.
See also
- Return type:
float
- band(self) int [source]¶
Returns the band used by the renderer
Deprecated since version 3.38: Use
inputBand()
instead.- Return type:
int
- static create(elem: QDomElement, input: QgsRasterInterface | None) QgsRasterRenderer | None [source]¶
Factory method to create a new renderer
- Parameters:
elem (QDomElement) – A DOM element to create the renderer from.
input (Optional[QgsRasterInterface]) – The raster input interface.
- Return type:
Optional[QgsRasterRenderer]
- Returns:
A new QgsHillshadeRenderer.
- multiDirectional(self) bool [source]¶
Returns
True
if the renderer is using multi-directional hillshading.See also
- Return type:
bool
- setAltitude(self, altitude: float)[source]¶
Set the altitude of the light source
- Parameters:
altitude (float) – the altitude
See also
- setAzimuth(self, azimuth: float)[source]¶
Set the azimuth of the light source.
- Parameters:
azimuth (float) – The azimuth of the light source, between 0 and 360.0
See also
- setBand(self, bandNo: int)[source]¶
Sets the band used by the renderer.
See also
Deprecated since version 3.38: Use
setInputBand()
instead.- Parameters:
bandNo (int)
- setMultiDirectional(self, isMultiDirectional: bool)[source]¶
Sets whether to render using a multi-directional hillshade algorithm.
- Parameters:
isMultiDirectional (bool) – set to
True
to use multi directional rendering
See also
- setZFactor(self, zfactor: float)[source]¶
Set the Z scaling factor of the result image.
- Parameters:
zfactor (float) – The z factor
See also