Class: QgsRasterLayerTemporalProperties

Implementation of map layer temporal properties for raster layers.

Added in version 3.14.

Class Hierarchy

Inheritance diagram of qgis.core.QgsRasterLayerTemporalProperties

Base classes

QgsMapLayerTemporalProperties

Base class for storage of map layer temporal properties.

QgsTemporalProperty

Base class for temporal property.

QObject

Enums

TemporalMode

alias of RasterTemporalMode

Methods

bandForTemporalRange

Returns the band corresponding to the specified range.

bandNumber

Returns the band number from which temporal values should be taken.

filteredBandsForTemporalRange

Returns a filtered list of bands which match the specified range.

fixedRangePerBand

Returns the fixed temporal range for each band.

fixedTemporalRange

Returns the fixed temporal range for the layer.

intervalHandlingMethod

Returns the desired method to use when resolving a temporal interval to matching layers or bands in the data provider.

mode

Returns the temporal properties mode.

setBandNumber

Sets the band number from which temporal values should be taken.

setFixedRangePerBand

Sets the fixed temporal range for each band.

setFixedTemporalRange

Sets a temporal range to apply to the whole layer.

setIntervalHandlingMethod

Sets the desired method to use when resolving a temporal interval to matching layers or bands in the data provider.

setMode

Sets the temporal properties mode.

setTemporalRepresentationOffset

Sets the temporal offset, which is a fixed datetime which should be added to individual pixel values from the layer.

setTemporalRepresentationScale

Sets the scale, which is an interval factor which should be applied to individual pixel values from the layer.

temporalRepresentationOffset

Returns the temporal offset, which is a fixed datetime which should be added to individual pixel values from the layer.

temporalRepresentationScale

Returns the scale, which is an interval factor which should be applied to individual pixel values from the layer.

class qgis.core.QgsRasterLayerTemporalProperties[source]

Bases: QgsMapLayerTemporalProperties

__init__(parent: QObject | None = None, enabled: bool = False)

Constructor for QgsRasterLayerTemporalProperties, with the specified parent object.

The enabled argument specifies whether the temporal properties are initially enabled or not (see isActive()).

Parameters:
  • parent (Optional[QObject] = None)

  • enabled (bool = False)

TemporalMode

alias of RasterTemporalMode

bandForTemporalRange(self, layer: QgsRasterLayer | None, range: QgsDateTimeRange) int[source]

Returns the band corresponding to the specified range.

Note

This is only considered when mode() is Qgis.RasterTemporalMode.FixedRangePerBand. For other modes it will always return -1.

Added in version 3.38.

Parameters:
Return type:

int

bandNumber(self) int[source]

Returns the band number from which temporal values should be taken.

Note

This is only considered when mode() is Qgis.RasterTemporalMode.RepresentsTemporalValues.

See also

setBandNumber()

Added in version 3.38.

Return type:

int

filteredBandsForTemporalRange(self, layer: QgsRasterLayer | None, range: QgsDateTimeRange) List[int]

Returns a filtered list of bands which match the specified range.

Added in version 3.38.

Parameters:
Return type:

List[int]

fixedRangePerBand(self) Dict[int, QgsDateTimeRange]

Returns the fixed temporal range for each band.

Note

This is only considered when mode() is Qgis.RasterTemporalMode.FixedRangePerBand.

Added in version 3.38.

Return type:

Dict[int, QgsDateTimeRange]

fixedTemporalRange(self) QgsDateTimeRange

Returns the fixed temporal range for the layer.

Warning

To be used only when mode() is Qgis.RasterTemporalMode.FixedTemporalRange

Return type:

QgsDateTimeRange

intervalHandlingMethod(self) Qgis.TemporalIntervalMatchMethod[source]

Returns the desired method to use when resolving a temporal interval to matching layers or bands in the data provider.

Return type:

Qgis.TemporalIntervalMatchMethod

mode(self) Qgis.RasterTemporalMode[source]

Returns the temporal properties mode.

See also

setMode()

Return type:

Qgis.RasterTemporalMode

setBandNumber(self, number: int)[source]

Sets the band number from which temporal values should be taken.

Note

This is only considered when mode() is Qgis.RasterTemporalMode.RepresentsTemporalValues.

See also

bandNumber()

Added in version 3.38.

Parameters:

number (int)

setFixedRangePerBand(self, ranges: Dict[int, QgsDateTimeRange])[source]

Sets the fixed temporal range for each band.

Note

This is only considered when mode() is Qgis.RasterTemporalMode.FixedRangePerBand.

Added in version 3.38.

Parameters:

ranges (Dict[int, QgsDateTimeRange])

setFixedTemporalRange(self, range: QgsDateTimeRange)[source]

Sets a temporal range to apply to the whole layer. All bands from the raster layer will be rendered whenever the current datetime range of a render context intersects the specified range.

Warning

This setting is only effective when mode() is Qgis.RasterTemporalMode.FixedTemporalRange

Parameters:

range (QgsDateTimeRange)

setIntervalHandlingMethod(self, method: Qgis.TemporalIntervalMatchMethod)[source]

Sets the desired method to use when resolving a temporal interval to matching layers or bands in the data provider.

Parameters:

method (Qgis.TemporalIntervalMatchMethod)

setMode(self, mode: Qgis.RasterTemporalMode)[source]

Sets the temporal properties mode.

See also

mode()

Parameters:

mode (Qgis.RasterTemporalMode)

setTemporalRepresentationOffset(self, offset: QDateTime | datetime.datetime)[source]

Sets the temporal offset, which is a fixed datetime which should be added to individual pixel values from the layer.

Note

This is only considered when mode() is Qgis.RasterTemporalMode.RepresentsTemporalValues.

Added in version 3.38.

Parameters:

offset (Union[QDateTime, datetime.datetime])

setTemporalRepresentationScale(self, scale: QgsInterval)[source]

Sets the scale, which is an interval factor which should be applied to individual pixel values from the layer.

Note

This is only considered when mode() is Qgis.RasterTemporalMode.RepresentsTemporalValues.

Added in version 3.38.

Parameters:

scale (QgsInterval)

temporalRepresentationOffset(self) QDateTime[source]

Returns the temporal offset, which is a fixed datetime which should be added to individual pixel values from the layer.

Note

This is only considered when mode() is Qgis.RasterTemporalMode.RepresentsTemporalValues.

Added in version 3.38.

Return type:

QDateTime

temporalRepresentationScale(self) QgsInterval

Returns the scale, which is an interval factor which should be applied to individual pixel values from the layer.

Note

This is only considered when mode() is Qgis.RasterTemporalMode.RepresentsTemporalValues.

Added in version 3.38.

Return type:

QgsInterval