Class: QgsHillshadeRenderer

class qgis.core.QgsHillshadeRenderer(input: QgsRasterInterface, band: int, lightAzimuth: float, lightAltitude: float)

Bases: QgsRasterRenderer

A renderer for generating live hillshade models.

Parameters
  • input (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

A renderer for generating live hillshade models.

Methods

altitude

Returns the angle of the light source over the raster.

azimuth

Returns the direction of the light over the raster between 0-360.

band

Returns the band used by the renderer

block

param bandNo

clone

rtype

QgsHillshadeRenderer

create

Factory method to create a new renderer

initHistogram

initStatistics

multiDirectional

Returns True if the renderer is using multi-directional hillshading.

renderColorForNodataPixel

setAltitude

Set the altitude of the light source

setAzimuth

Set the azimuth of the light source.

setBand

Sets the band used by the renderer.

setMultiDirectional

Sets whether to render using a multi-directional hillshade algorithm.

setZFactor

Set the Z scaling factor of the result image.

toSld

param doc

usesBands

rtype

List[int]

writeXml

param doc

zFactor

Returns the Z scaling factor.

altitude(self) → float

Returns the angle of the light source over the raster.

See also

setAltitude()

Return type

float

azimuth(self) → float

Returns the direction of the light over the raster between 0-360.

See also

setAzimuth()

Return type

float

band(self) → int

Returns the band used by the renderer

Return type

int

block(self, bandNo: int, extent: QgsRectangle, width: int, height: int, feedback: QgsRasterBlockFeedback = None) → QgsRasterBlock
Parameters
Return type

QgsRasterBlock

clone(self) → QgsHillshadeRenderer
Return type

QgsHillshadeRenderer

create(elem: QDomElement, input: QgsRasterInterface) → QgsRasterRenderer

Factory method to create a new renderer

Parameters
  • elem (QDomElement) – A DOM element to create the renderer from.

  • input (QgsRasterInterface) – The raster input interface.

Return type

QgsRasterRenderer

Returns

A new QgsHillshadeRenderer.

initHistogram()
initStatistics()
multiDirectional(self) → bool

Returns True if the renderer is using multi-directional hillshading.

Return type

bool

renderColorForNodataPixel()
setAltitude(self, altitude: float)

Set the altitude of the light source

Parameters

altitude (float) – the altitude

See also

altitude()

setAzimuth(self, azimuth: float)

Set the azimuth of the light source.

Parameters

azimuth (float) – The azimuth of the light source, between 0 and 360.0

See also

azimuth()

setBand(self, bandNo: int)

Sets the band used by the renderer.

See also

band()

Parameters

bandNo (int) –

setMultiDirectional(self, isMultiDirectional: bool)

Sets whether to render using a multi-directional hillshade algorithm.

Parameters

isMultiDirectional (bool) – set to True to use multi directional rendering

setZFactor(self, zfactor: float)

Set the Z scaling factor of the result image.

Parameters

zfactor (float) – The z factor

See also

zFactor()

toSld(self, doc: QDomDocument, element: QDomElement, props: Dict[str, str] = {})
Parameters
  • doc (QDomDocument) –

  • element (QDomElement) –

  • props (Dict[str) –

usesBands(self) → List[int]
Return type

List[int]

writeXml(self, doc: QDomDocument, parentElem: QDomElement)
Parameters
  • doc (QDomDocument) –

  • parentElem (QDomElement) –

zFactor(self) → float

Returns the Z scaling factor.

See also

setZFactor()

Return type

float