Class: QgsMeshDataProviderTemporalCapabilities

class qgis.core.QgsMeshDataProviderTemporalCapabilities

Bases: QgsDataProviderTemporalCapabilities

Class for handling properties relating to a mesh data provider’s temporal capabilities.

Added in version 3.14.

QgsMeshDataProviderTemporalCapabilities() Constructor for QgsMeshDataProviderTemporalCapabilities

QgsMeshDataProviderTemporalCapabilities(a0: QgsMeshDataProviderTemporalCapabilities)

Methods

clear

Clears all stored reference times and dataset times

datasetIndexClosestBeforeRelativeTime

Returns the last dataset with time less than or equal to timeSinceGlobalReference

datasetIndexClosestFromRelativeTime

Returns the closest dataset index from the timeSinceGlobalReference

datasetTime

Returns the relative time in milliseconds of the dataset

firstTimeStepDuration

Returns the duration of the first time step of the dataset group with index group

hasReferenceTime

Returns whether the reference time is set

referenceTime

Returns the reference time

setTemporalUnit

Sets the temporal unit (temporalUnit) used to read data by the data provider

temporalUnit

Returns the temporal unit used to read data by the data provider

timeExtent

Returns the time extent using the internal reference time and the first and last times available from the all the dataset

Attributes

FindClosestDatasetBeforeStartRangeTime

FindClosestDatasetFromStartRangeTime

FindClosestDatasetBeforeStartRangeTime = 0
FindClosestDatasetFromStartRangeTime = 1
class MatchingTemporalDatasetMethod

Bases: int

clear(self)

Clears all stored reference times and dataset times

datasetIndexClosestBeforeRelativeTime(self, group: int, timeSinceGlobalReference: int) QgsMeshDatasetIndex

Returns the last dataset with time less than or equal to timeSinceGlobalReference

Returns invalid dataset index if timeSinceGlobalReference is outside the time extent of the dataset group

Note

for non temporal dataset group, timeSinceGlobalReference is not used and the unique dataset is returned

Parameters:
  • group (int)

  • timeSinceGlobalReference (int)

Return type:

QgsMeshDatasetIndex

datasetIndexClosestFromRelativeTime(self, group: int, timeSinceGlobalReference: int) QgsMeshDatasetIndex

Returns the closest dataset index from the timeSinceGlobalReference

Returns invalid dataset index if timeSinceGlobalReference is outside the time extent of the dataset group

Note

for non temporal dataset group, timeSinceGlobalReference is not used and the unique dataset is returned

Parameters:
  • group (int)

  • timeSinceGlobalReference (int)

Return type:

QgsMeshDatasetIndex

datasetTime(self, index: QgsMeshDatasetIndex) int

Returns the relative time in milliseconds of the dataset

Parameters:

index (QgsMeshDatasetIndex)

Return type:

int

firstTimeStepDuration(self, group: int) int

Returns the duration of the first time step of the dataset group with index group

The value is -1 if the dataset group is not present or if it contains only one dataset (non temporal dataset)

Parameters:

group (int)

Return type:

int

hasReferenceTime(self) bool

Returns whether the reference time is set

Return type:

bool

referenceTime(self) QDateTime

Returns the reference time

Return type:

QDateTime

setTemporalUnit(self, temporalUnit: Qgis.TemporalUnit)

Sets the temporal unit (temporalUnit) used to read data by the data provider

Temporal units supported are milliseconds, seconds, minutes, hors, days and weeks

Parameters:

temporalUnit (Qgis.TemporalUnit)

temporalUnit(self) Qgis.TemporalUnit

Returns the temporal unit used to read data by the data provider

Return type:

Qgis.TemporalUnit

timeExtent(self) QgsDateTimeRange

Returns the time extent using the internal reference time and the first and last times available from the all the dataset

timeExtent(self, reference: Union[QDateTime, datetime.datetime]) -> QgsDateTimeRange Returns the time extent using an external reference date time and the first and last times available from the all the dataset

Return type:

QgsDateTimeRange