QGIS API Documentation 3.99.0-Master (752b475928d)
Loading...
Searching...
No Matches
QgsRasterLayerTemporalProperties Class Reference

Implementation of map layer temporal properties for raster layers. More...

#include <qgsrasterlayertemporalproperties.h>

Inheritance diagram for QgsRasterLayerTemporalProperties:

Public Member Functions

 QgsRasterLayerTemporalProperties (QObject *parent=nullptr, bool enabled=false)
 Constructor for QgsRasterLayerTemporalProperties, with the specified parent object.
bool accumulatePixels () const
 Returns true if pixels will be accumulated over time (i.e.
QList< QgsDateTimeRangeallTemporalRanges (QgsMapLayer *layer) const override
 Attempts to calculate the overall list of all temporal extents which are contained in the specified layer, using the settings defined by the temporal properties object.
int bandForTemporalRange (QgsRasterLayer *layer, const QgsDateTimeRange &range) const
 Returns the band corresponding to the specified range.
int bandNumber () const
 Returns the band number from which temporal values should be taken.
QgsDateTimeRange calculateTemporalExtent (QgsMapLayer *layer) const override
 Attempts to calculate the overall temporal extent for the specified layer, using the settings defined by the temporal properties object.
QList< int > filteredBandsForTemporalRange (QgsRasterLayer *layer, const QgsDateTimeRange &range) const
 Returns a filtered list of bands which match the specified range.
QMap< int, QgsDateTimeRangefixedRangePerBand () const
 Returns the fixed temporal range for each band.
const QgsDateTimeRangefixedTemporalRange () const
 Returns the fixed temporal range for the layer.
QgsTemporalProperty::Flags flags () const override
 Returns flags associated to the temporal property.
Qgis::TemporalIntervalMatchMethod intervalHandlingMethod () const
 Returns the desired method to use when resolving a temporal interval to matching layers or bands in the data provider.
bool isVisibleInTemporalRange (const QgsDateTimeRange &range) const override
 Returns true if the layer should be visible and rendered for the specified time range.
Qgis::RasterTemporalMode mode () const
 Returns the temporal properties mode.
bool readXml (const QDomElement &element, const QgsReadWriteContext &context) override
 Reads temporal properties from a DOM element previously written by writeXml().
void setAccumulatePixels (bool accumulate)
 Sets whether pixels will be accumulated over time (i.e.
void setBandNumber (int number)
 Sets the band number from which temporal values should be taken.
void setDefaultsFromDataProviderTemporalCapabilities (const QgsDataProviderTemporalCapabilities *capabilities) override
 Sets the layers temporal settings to appropriate defaults based on a provider's temporal capabilities.
void setFixedRangePerBand (const QMap< int, QgsDateTimeRange > &ranges)
 Sets the fixed temporal range for each band.
void setFixedTemporalRange (const QgsDateTimeRange &range)
 Sets a temporal range to apply to the whole layer.
void setIntervalHandlingMethod (Qgis::TemporalIntervalMatchMethod method)
 Sets the desired method to use when resolving a temporal interval to matching layers or bands in the data provider.
void setMode (Qgis::RasterTemporalMode mode)
 Sets the temporal properties mode.
void setTemporalRepresentationOffset (const QDateTime &offset)
 Sets the temporal offset, which is a fixed datetime which should be added to individual pixel values from the layer.
void setTemporalRepresentationScale (const QgsInterval &scale)
 Sets the scale, which is an interval factor which should be applied to individual pixel values from the layer.
QDateTime temporalRepresentationOffset () const
 Returns the temporal offset, which is a fixed datetime which should be added to individual pixel values from the layer.
const QgsIntervaltemporalRepresentationScale () const
 Returns the scale, which is an interval factor which should be applied to individual pixel values from the layer.
QDomElement writeXml (QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context) override
 Writes the properties to a DOM element, to be used later with readXml().
Public Member Functions inherited from QgsMapLayerTemporalProperties
 QgsMapLayerTemporalProperties (QObject *parent, bool enabled=false)
 Constructor for QgsMapLayerTemporalProperties, with the specified parent object.
Public Member Functions inherited from QgsTemporalProperty
 QgsTemporalProperty (QObject *parent=nullptr, bool enabled=false)
 Constructor for QgsTemporalProperty, with the specified parent object.
bool isActive () const
 Returns true if the temporal property is active.
void setIsActive (bool active)
 Sets whether the temporal property is active.

Additional Inherited Members

Public Types inherited from QgsTemporalProperty
enum  Flag { FlagDontInvalidateCachedRendersWhenRangeChanges = 1 }
 Flags attached to the temporal property. More...
typedef QFlags< FlagFlags
Signals inherited from QgsTemporalProperty
void changed ()
 Emitted when the temporal properties have changed.

Detailed Description

Implementation of map layer temporal properties for raster layers.

Since
QGIS 3.14

Definition at line 38 of file qgsrasterlayertemporalproperties.h.

Constructor & Destructor Documentation

◆ QgsRasterLayerTemporalProperties()

QgsRasterLayerTemporalProperties::QgsRasterLayerTemporalProperties ( QObject * parent = nullptr,
bool enabled = false )

Constructor for QgsRasterLayerTemporalProperties, with the specified parent object.

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

Definition at line 25 of file qgsrasterlayertemporalproperties.cpp.

Member Function Documentation

◆ accumulatePixels()

bool QgsRasterLayerTemporalProperties::accumulatePixels ( ) const

Returns true if pixels will be accumulated over time (i.e.

all pixels which occur before or within the map's temporal range should be rendered).

Warning
This setting is only effective when mode() is Qgis::RasterTemporalMode::RepresentsTemporalValues
See also
setAccumulatePixels()
Since
QGIS 4.0

Definition at line 318 of file qgsrasterlayertemporalproperties.cpp.

◆ allTemporalRanges()

QList< QgsDateTimeRange > QgsRasterLayerTemporalProperties::allTemporalRanges ( QgsMapLayer * layer) const
overridevirtual

Attempts to calculate the overall list of all temporal extents which are contained in the specified layer, using the settings defined by the temporal properties object.

May return an empty list if the ranges could not be calculated.

Since
QGIS 3.20

Reimplemented from QgsMapLayerTemporalProperties.

Definition at line 113 of file qgsrasterlayertemporalproperties.cpp.

◆ bandForTemporalRange()

int QgsRasterLayerTemporalProperties::bandForTemporalRange ( QgsRasterLayer * layer,
const QgsDateTimeRange & range ) const

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.
Since
QGIS 3.38

Definition at line 216 of file qgsrasterlayertemporalproperties.cpp.

◆ bandNumber()

int QgsRasterLayerTemporalProperties::bandNumber ( ) const

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()
Since
QGIS 3.38

Definition at line 292 of file qgsrasterlayertemporalproperties.cpp.

◆ calculateTemporalExtent()

QgsDateTimeRange QgsRasterLayerTemporalProperties::calculateTemporalExtent ( QgsMapLayer * layer) const
overridevirtual

Attempts to calculate the overall temporal extent for the specified layer, using the settings defined by the temporal properties object.

May return an infinite range if the extent could not be calculated.

Note
Not available in Python bindings

Reimplemented from QgsMapLayerTemporalProperties.

Definition at line 60 of file qgsrasterlayertemporalproperties.cpp.

◆ filteredBandsForTemporalRange()

QList< int > QgsRasterLayerTemporalProperties::filteredBandsForTemporalRange ( QgsRasterLayer * layer,
const QgsDateTimeRange & range ) const

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

Since
QGIS 3.38

Definition at line 253 of file qgsrasterlayertemporalproperties.cpp.

◆ fixedRangePerBand()

QMap< int, QgsDateTimeRange > QgsRasterLayerTemporalProperties::fixedRangePerBand ( ) const

Returns the fixed temporal range for each band.

Note
This is only considered when mode() is Qgis::RasterTemporalMode::FixedRangePerBand.
See also
setFixedRangePerBand()
Since
QGIS 3.38

Definition at line 202 of file qgsrasterlayertemporalproperties.cpp.

◆ fixedTemporalRange()

const QgsDateTimeRange & QgsRasterLayerTemporalProperties::fixedTemporalRange ( ) const

Returns the fixed temporal range for the layer.

Warning
To be used only when mode() is Qgis::RasterTemporalMode::FixedTemporalRange
See also
setFixedTemporalRange()

Definition at line 197 of file qgsrasterlayertemporalproperties.cpp.

◆ flags()

QgsTemporalProperty::Flags QgsRasterLayerTemporalProperties::flags ( ) const
overridevirtual

Returns flags associated to the temporal property.

Reimplemented from QgsTemporalProperty.

Definition at line 163 of file qgsrasterlayertemporalproperties.cpp.

◆ intervalHandlingMethod()

Qgis::TemporalIntervalMatchMethod QgsRasterLayerTemporalProperties::intervalHandlingMethod ( ) const

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

See also
setIntervalHandlingMethod()

Definition at line 180 of file qgsrasterlayertemporalproperties.cpp.

◆ isVisibleInTemporalRange()

bool QgsRasterLayerTemporalProperties::isVisibleInTemporalRange ( const QgsDateTimeRange & range) const
overridevirtual

Returns true if the layer should be visible and rendered for the specified time range.

Reimplemented from QgsMapLayerTemporalProperties.

Definition at line 31 of file qgsrasterlayertemporalproperties.cpp.

◆ mode()

Qgis::RasterTemporalMode QgsRasterLayerTemporalProperties::mode ( ) const

Returns the temporal properties mode.

See also
setMode()

Definition at line 151 of file qgsrasterlayertemporalproperties.cpp.

◆ readXml()

bool QgsRasterLayerTemporalProperties::readXml ( const QDomElement & element,
const QgsReadWriteContext & context )
overridevirtual

Reads temporal properties from a DOM element previously written by writeXml().

See also
writeXml()

Implements QgsMapLayerTemporalProperties.

Definition at line 341 of file qgsrasterlayertemporalproperties.cpp.

◆ setAccumulatePixels()

void QgsRasterLayerTemporalProperties::setAccumulatePixels ( bool accumulate)

Sets whether pixels will be accumulated over time (i.e.

all pixels which occur before or within the map's temporal range should be rendered).

Warning
This setting is only effective when mode() is Qgis::RasterTemporalMode::RepresentsTemporalValues
See also
accumulatePixels()
Since
QGIS 4.0

Definition at line 323 of file qgsrasterlayertemporalproperties.cpp.

◆ setBandNumber()

void QgsRasterLayerTemporalProperties::setBandNumber ( int number)

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()
Since
QGIS 3.38

Definition at line 297 of file qgsrasterlayertemporalproperties.cpp.

◆ setDefaultsFromDataProviderTemporalCapabilities()

void QgsRasterLayerTemporalProperties::setDefaultsFromDataProviderTemporalCapabilities ( const QgsDataProviderTemporalCapabilities * capabilities)
overridevirtual

Sets the layers temporal settings to appropriate defaults based on a provider's temporal capabilities.

Implements QgsMapLayerTemporalProperties.

Definition at line 495 of file qgsrasterlayertemporalproperties.cpp.

◆ setFixedRangePerBand()

void QgsRasterLayerTemporalProperties::setFixedRangePerBand ( const QMap< int, QgsDateTimeRange > & ranges)

Sets the fixed temporal range for each band.

Note
This is only considered when mode() is Qgis::RasterTemporalMode::FixedRangePerBand.
See also
fixedRangePerBand()
Since
QGIS 3.38

Definition at line 207 of file qgsrasterlayertemporalproperties.cpp.

◆ setFixedTemporalRange()

void QgsRasterLayerTemporalProperties::setFixedTemporalRange ( const QgsDateTimeRange & range)

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
See also
fixedTemporalRange()

Definition at line 192 of file qgsrasterlayertemporalproperties.cpp.

◆ setIntervalHandlingMethod()

void QgsRasterLayerTemporalProperties::setIntervalHandlingMethod ( Qgis::TemporalIntervalMatchMethod method)

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

See also
intervalHandlingMethod()

Definition at line 185 of file qgsrasterlayertemporalproperties.cpp.

◆ setMode()

void QgsRasterLayerTemporalProperties::setMode ( Qgis::RasterTemporalMode mode)

Sets the temporal properties mode.

See also
mode()

Definition at line 156 of file qgsrasterlayertemporalproperties.cpp.

◆ setTemporalRepresentationOffset()

void QgsRasterLayerTemporalProperties::setTemporalRepresentationOffset ( const QDateTime & offset)

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.
See also
temporalRepresentationOffset()
Since
QGIS 3.38

Definition at line 310 of file qgsrasterlayertemporalproperties.cpp.

◆ setTemporalRepresentationScale()

void QgsRasterLayerTemporalProperties::setTemporalRepresentationScale ( const QgsInterval & scale)

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.
See also
temporalRepresentationScale()
Since
QGIS 3.38

Definition at line 333 of file qgsrasterlayertemporalproperties.cpp.

◆ temporalRepresentationOffset()

QDateTime QgsRasterLayerTemporalProperties::temporalRepresentationOffset ( ) const

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.
See also
setTemporalRepresentationOffset()
Since
QGIS 3.38

Definition at line 305 of file qgsrasterlayertemporalproperties.cpp.

◆ temporalRepresentationScale()

const QgsInterval & QgsRasterLayerTemporalProperties::temporalRepresentationScale ( ) const

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.
See also
setTemporalRepresentationScale()
Since
QGIS 3.38

Definition at line 328 of file qgsrasterlayertemporalproperties.cpp.

◆ writeXml()

QDomElement QgsRasterLayerTemporalProperties::writeXml ( QDomElement & element,
QDomDocument & doc,
const QgsReadWriteContext & context )
overridevirtual

Writes the properties to a DOM element, to be used later with readXml().

See also
readXml()

Implements QgsMapLayerTemporalProperties.

Definition at line 416 of file qgsrasterlayertemporalproperties.cpp.


The documentation for this class was generated from the following files: