Class: QgsElevationShadingRenderer

class qgis.core.QgsElevationShadingRenderer

Bases: sip.wrapper

This class can render elevation shading on an image with different methods (eye dome lighting, hillshading, …).

An instance of this class supports the following settings:

  • activate/deactivate elevation shading

  • activate/deactivate a particular shading method

  • parameters of each shading method

To render shading on image the caller call renderShading() with the image and an elevation map (see QgsElevationMap()) as parameters. The shading is applied on the image in place. Elevation map and image must have same sizes.

New in version 3.30:

Methods

combinedElevationMethod

Returns the method used when conbining different elevation sources.

eyeDomeLightingDistance

Returns the distance of the eye dome lighting method, that is the distance where the effect is apply from the source elevation.

eyeDomeLightingDistanceUnit

Returns the unit of the distance of the eye dome lighting method returned by eyeDomeLightingDistance().

eyeDomeLightingStrength

Returns the strength of the eye dome lighting method.

hillshadingZFactor

Returns the z factor used by the hill shading method.

isActive

Returns whether this shading renderer is active.

isActiveEyeDomeLighting

Returns whether eye-dome lighting shading method is active

isActiveHillshading

Returns whether the hillshading is active

isHillshadingMultidirectional

Returns whether the hill shading method is multidirectional.

lightAltitude

Returns the altitude of the light (degree) that can be used by some methods (e.g. hill shading).

lightAzimuth

Returns the azimuth of the light (degree) that can be used by some methods (e.g. hill shading).

readXml

Reads configuration from a DOM element

renderShading

Render shading on image condidering the elevation map elevation and the renderer context context If elevation map and the image don't have same sizes, nothing happens.

setActive

Sets whether this shading renderer is active.

setActiveEyeDomeLighting

Sets active the eye-dome lighting shading method.

setActiveHillshading

Sets active the hillshading

setCombinedElevationMethod

Sets the method used when conbining different elevation sources.

setEyeDomeLightingDistance

Sets the distance of the eye dome lighting method, that is the distance where the effect is apply from the source elevation.

setEyeDomeLightingDistanceUnit

Sets the unit of the distance of the eye dome lighting method set by setEyeDomeLightingDistance().

setEyeDomeLightingStrength

Sets the strength of the eye dome lighting method.

setHillshadingMultidirectional

Sets whether the hill shading method is multidirectional.

setHillshadingZFactor

Sets the z factor used by the hill shading method.

setLightAltitude

Sets the altitude of the light (degree) that can be used by some methods (e.g. hill shading).

setLightAzimuth

Sets the azimuth of the light (degree) that can be used by some methods (e.g. hill shading).

writeXml

Writes configuration on a DOM element

combinedElevationMethod(self) Qgis.ElevationMapCombineMethod

Returns the method used when conbining different elevation sources.

Return type:

Qgis.ElevationMapCombineMethod

eyeDomeLightingDistance(self) float

Returns the distance of the eye dome lighting method, that is the distance where the effect is apply from the source elevation.

Return type:

float

eyeDomeLightingDistanceUnit(self) Qgis.RenderUnit

Returns the unit of the distance of the eye dome lighting method returned by eyeDomeLightingDistance().

Return type:

Qgis.RenderUnit

eyeDomeLightingStrength(self) float

Returns the strength of the eye dome lighting method.

Return type:

float

hillshadingZFactor(self) float

Returns the z factor used by the hill shading method.

Return type:

float

isActive(self) bool

Returns whether this shading renderer is active.

Return type:

bool

isActiveEyeDomeLighting(self) bool

Returns whether eye-dome lighting shading method is active

Return type:

bool

isActiveHillshading(self) bool

Returns whether the hillshading is active

Return type:

bool

isHillshadingMultidirectional(self) bool

Returns whether the hill shading method is multidirectional.

Return type:

bool

lightAltitude(self) float

Returns the altitude of the light (degree) that can be used by some methods (e.g. hill shading).

Return type:

float

lightAzimuth(self) float

Returns the azimuth of the light (degree) that can be used by some methods (e.g. hill shading).

Return type:

float

readXml(self, element: QDomElement, context: QgsReadWriteContext)

Reads configuration from a DOM element

Parameters:
renderShading(self, elevation: QgsElevationMap, image: QImage, context: QgsRenderContext)

Render shading on image condidering the elevation map elevation and the renderer context context If elevation map and the image don’t have same sizes, nothing happens.

Parameters:
setActive(self, active: bool)

Sets whether this shading renderer is active.

Parameters:

active (bool) –

setActiveEyeDomeLighting(self, active: bool)

Sets active the eye-dome lighting shading method.

Parameters:

active (bool) –

setActiveHillshading(self, active: bool)

Sets active the hillshading

Parameters:

active (bool) –

setCombinedElevationMethod(self, method: Qgis.ElevationMapCombineMethod)

Sets the method used when conbining different elevation sources.

Parameters:

method (Qgis.ElevationMapCombineMethod) –

setEyeDomeLightingDistance(self, distance: float)

Sets the distance of the eye dome lighting method, that is the distance where the effect is apply from the source elevation.

Parameters:

distance (float) –

setEyeDomeLightingDistanceUnit(self, unit: Qgis.RenderUnit)

Sets the unit of the distance of the eye dome lighting method set by setEyeDomeLightingDistance().

Parameters:

unit (Qgis.RenderUnit) –

setEyeDomeLightingStrength(self, strength: float)

Sets the strength of the eye dome lighting method.

Parameters:

strength (float) –

setHillshadingMultidirectional(self, multiDirectional: bool)

Sets whether the hill shading method is multidirectional.

Parameters:

multiDirectional (bool) –

setHillshadingZFactor(self, zFactor: float)

Sets the z factor used by the hill shading method.

Parameters:

zFactor (float) –

setLightAltitude(self, lightAltitude: float)

Sets the altitude of the light (degree) that can be used by some methods (e.g. hill shading).

Parameters:

lightAltitude (float) –

setLightAzimuth(self, lightAzimuth: float)

Sets the azimuth of the light (degree) that can be used by some methods (e.g. hill shading).

See also

lightAzimuth()

Parameters:

lightAzimuth (float) –

writeXml(self, elem: QDomElement, context: QgsReadWriteContext)

Writes configuration on a DOM element

Parameters: