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
Returns the method used when conbining different elevation sources.
Returns the distance of the eye dome lighting method, that is the distance where the effect is apply from the source elevation.
Returns the unit of the distance of the eye dome lighting method returned by
eyeDomeLightingDistance()
.Returns the strength of the eye dome lighting method.
Returns the z factor used by the hill shading method.
Returns whether this shading renderer is active.
Returns whether eye-dome lighting shading method is active
Returns whether the hillshading is active
Returns whether the hill shading method is multidirectional.
Returns the altitude of the light (degree) that can be used by some methods (e.g.
Returns the azimuth of the light (degree) that can be used by some methods (e.g.
Reads configuration from a DOM element
Render shading on
image
condidering the elevation mapelevation
and the renderer contextcontext
If elevation map and the image don't have same sizes, nothing happens.Sets whether this shading renderer is active.
Sets active the eye-dome lighting shading method.
Sets active the hillshading
Sets the
method
used when conbining different elevation sources.Sets the distance of the eye dome lighting method, that is the distance where the effect is apply from the source elevation.
Sets the
unit
of the distance of the eye dome lighting method set bysetEyeDomeLightingDistance()
.Sets the
strength
of the eye dome lighting method.Sets whether the hill shading method is multidirectional.
Sets the z factor used by the hill shading method.
Sets the altitude of the light (degree) that can be used by some methods (e.g.
Sets the azimuth of the light (degree) that can be used by some methods (e.g.
Writes configuration on a DOM element
- combinedElevationMethod(self) Qgis.ElevationMapCombineMethod ¶
Returns the method used when conbining different elevation sources.
See also
- Return type:
- 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.
See also
- Return type:
float
- eyeDomeLightingDistanceUnit(self) Qgis.RenderUnit ¶
Returns the unit of the distance of the eye dome lighting method returned by
eyeDomeLightingDistance()
.See also
- Return type:
- eyeDomeLightingStrength(self) float ¶
Returns the strength of the eye dome lighting method.
See also
- Return type:
float
- hillshadingZFactor(self) float ¶
Returns the z factor used by the hill shading method.
See also
- 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.
See also
- Return type:
bool
- lightAltitude(self) float ¶
Returns the altitude of the light (degree) that can be used by some methods (e.g. hill shading).
See also
- Return type:
float
- lightAzimuth(self) float ¶
Returns the azimuth of the light (degree) that can be used by some methods (e.g. hill shading).
See also
- Return type:
float
- readXml(self, element: QDomElement, context: QgsReadWriteContext)¶
Reads configuration from a DOM element
- Parameters:
element (QDomElement) –
context (QgsReadWriteContext) –
- renderShading(self, elevation: QgsElevationMap, image: QImage, context: QgsRenderContext)¶
Render shading on
image
condidering the elevation mapelevation
and the renderer contextcontext
If elevation map and the image don’t have same sizes, nothing happens.- Parameters:
elevation (QgsElevationMap) –
image (QImage) –
context (QgsRenderContext) –
- 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.See also
- 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.
See also
- Parameters:
distance (float) –
- setEyeDomeLightingDistanceUnit(self, unit: Qgis.RenderUnit)¶
Sets the
unit
of the distance of the eye dome lighting method set bysetEyeDomeLightingDistance()
.See also
- Parameters:
unit (Qgis.RenderUnit) –
- setEyeDomeLightingStrength(self, strength: float)¶
Sets the
strength
of the eye dome lighting method.See also
- Parameters:
strength (float) –
- setHillshadingMultidirectional(self, multiDirectional: bool)¶
Sets whether the hill shading method is multidirectional.
See also
- Parameters:
multiDirectional (bool) –
- setHillshadingZFactor(self, zFactor: float)¶
Sets the z factor used by the hill shading method.
See also
- 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).
See also
- 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
- Parameters:
lightAzimuth (float) –
- writeXml(self, elem: QDomElement, context: QgsReadWriteContext)¶
Writes configuration on a DOM element
- Parameters:
elem (QDomElement) –
context (QgsReadWriteContext) –