Class: QgsRasterLayerElevationProperties¶
Raster layer specific subclass of
QgsMapLayerElevationProperties
.
Added in version 3.26.
Class Hierarchy¶
Base classes¶
Base class for storage of map layer elevation properties. |
|
Methods
Returns the band corresponding to the specified range. |
|
Returns the band number from which the elevation should be taken. |
|
Returns the elevation limit, which is used when |
|
Returns the elevation range corresponding to a raw pixel value from the specified band. |
|
Returns the fixed elevation range for the raster. |
|
Returns the fixed elevation range for each band. |
|
Returns |
|
Returns the elevation mode. |
|
Returns the fill symbol used to render the raster profile in elevation profile plots. |
|
Returns the line symbol used to render the raster profile in elevation profile plots. |
|
Returns the symbology option used to render the raster profile in elevation profile plots. |
|
Sets the band number from which the elevation should be taken. |
|
Sets the elevation limit, which is used when |
|
Sets whether the elevation properties are enabled, i.e. the raster layer values represent an elevation surface. |
|
Sets the fixed elevation range for the raster. |
|
Sets the fixed elevation range for each band. |
|
Sets the elevation mode. |
|
Sets the fill symbol used to render the raster profile in elevation profile plots. |
|
Sets the line symbol used to render the raster profile in elevation profile plots. |
|
Sets the symbology option used to render the raster profile in elevation profile plots. |
Static Methods
Returns |
- class qgis.core.QgsRasterLayerElevationProperties[source]¶
Bases:
QgsMapLayerElevationProperties
- __init__(parent: QObject | None)
Constructor for QgsRasterLayerElevationProperties, with the specified
parent
object.- Parameters:
parent (Optional[QObject])
- bandForElevationRange(self, layer: QgsRasterLayer | None, range: QgsDoubleRange) int [source]¶
Returns the band corresponding to the specified
range
.Note
This is only considered when
mode()
isQgis
.RasterElevationMode.FixedRangePerBand orQgis
.RasterElevationMode.DynamicRangePerBand. For other modes it will always return -1.Added in version 3.38.
- Parameters:
layer (Optional[QgsRasterLayer])
range (QgsDoubleRange)
- Return type:
int
- bandNumber(self) int [source]¶
Returns the band number from which the elevation should be taken.
See also
- Return type:
int
- elevationLimit(self) float [source]¶
Returns the elevation limit, which is used when
profileSymbology()
isQgis
.ProfileSurfaceSymbology.FillBelow orQgis
.ProfileSurfaceSymbology.FillAbove to limit the fill to a specific elevation range.By default this is NaN, which indicates that there is no elevation limit.
See also
Added in version 3.32.
- Return type:
float
- elevationRangeForPixelValue(self, layer: QgsRasterLayer | None, band: int, pixelValue: float) QgsDoubleRange [source]¶
Returns the elevation range corresponding to a raw pixel value from the specified
band
.Returns an infinite range if the pixel value does not correspond to an elevation value.
Added in version 3.38.
- Parameters:
layer (Optional[QgsRasterLayer])
band (int)
pixelValue (float)
- Return type:
- fixedRange(self) QgsDoubleRange [source]¶
Returns the fixed elevation range for the raster.
Note
When a fixed range is set any
zOffset()
andzScale()
is ignored.See also
Added in version 3.38.
- Return type:
- fixedRangePerBand(self) Dict[int, QgsDoubleRange] ¶
Returns the fixed elevation range for each band.
Note
When a fixed range is set any
zOffset()
andzScale()
is ignored.See also
Added in version 3.38.
- Return type:
Dict[int, QgsDoubleRange]
- isEnabled(self) bool [source]¶
Returns
True
if the elevation properties are enabled, i.e. the raster layer values represent an elevation surface.See also
- Return type:
bool
- static layerLooksLikeDem(layer: QgsRasterLayer | None) bool [source]¶
Returns
True
if a rasterlayer
looks like a DEM.This method applies some heuristics to
layer
to determine whether it looks like a candidate for a DEM layer.Specifically, it checks:
the layer’s name for DEM-like wording hints
whether the layer contains a single band
whether the layer contains an attribute table (if so, it’s unlikely to be a DEM)
the layer’s data type
Added in version 3.32.
- Parameters:
layer (Optional[QgsRasterLayer])
- Return type:
bool
- mode(self) Qgis.RasterElevationMode [source]¶
Returns the elevation mode.
See also
Added in version 3.38.
- Return type:
- profileFillSymbol(self) QgsFillSymbol | None [source]¶
Returns the fill symbol used to render the raster profile in elevation profile plots.
See also
- Return type:
Optional[QgsFillSymbol]
- profileLineSymbol(self) QgsLineSymbol | None [source]¶
Returns the line symbol used to render the raster profile in elevation profile plots.
See also
- Return type:
Optional[QgsLineSymbol]
- profileSymbology(self) Qgis.ProfileSurfaceSymbology [source]¶
Returns the symbology option used to render the raster profile in elevation profile plots.
See also
- Return type:
- setBandNumber(self, band: int)[source]¶
Sets the
band
number from which the elevation should be taken.See also
- Parameters:
band (int)
- setElevationLimit(self, limit: float)[source]¶
Sets the elevation
limit
, which is used whenprofileSymbology()
isQgis
.ProfileSurfaceSymbology.FillBelow orQgis
.ProfileSurfaceSymbology.FillAbove to limit the fill to a specific elevation range.Set to NaN to indicate that there is no elevation limit.
See also
Added in version 3.32.
- Parameters:
limit (float)
- setEnabled(self, enabled: bool)[source]¶
Sets whether the elevation properties are enabled, i.e. the raster layer values represent an elevation surface.
See also
- Parameters:
enabled (bool)
- setFixedRange(self, range: QgsDoubleRange)[source]¶
Sets the fixed elevation
range
for the raster.Note
When a fixed range is set any
zOffset()
andzScale()
is ignored.See also
Added in version 3.38.
- Parameters:
range (QgsDoubleRange)
- setFixedRangePerBand(self, ranges: Dict[int, QgsDoubleRange])[source]¶
Sets the fixed elevation range for each band.
Note
When a fixed range is set any
zOffset()
andzScale()
is ignored.See also
Added in version 3.38.
- Parameters:
ranges (Dict[int, QgsDoubleRange])
- setMode(self, mode: Qgis.RasterElevationMode)[source]¶
Sets the elevation
mode
.See also
Added in version 3.38.
- Parameters:
mode (Qgis.RasterElevationMode)
- setProfileFillSymbol(self, symbol: QgsFillSymbol | None)[source]¶
Sets the fill
symbol
used to render the raster profile in elevation profile plots.Ownership of
symbol
is transferred to the plot.See also
- Parameters:
symbol (Optional[QgsFillSymbol])
- setProfileLineSymbol(self, symbol: QgsLineSymbol | None)[source]¶
Sets the line
symbol
used to render the raster profile in elevation profile plots.Ownership of
symbol
is transferred to the plot.See also
- Parameters:
symbol (Optional[QgsLineSymbol])
- setProfileSymbology(self, symbology: Qgis.ProfileSurfaceSymbology)[source]¶
Sets the
symbology
option used to render the raster profile in elevation profile plots.See also
- Parameters:
symbology (Qgis.ProfileSurfaceSymbology)