Class: QgsVectorLayerTemporalProperties¶
- class qgis.core.QgsVectorLayerTemporalProperties¶
Bases:
QgsMapLayerTemporalProperties
Implementation of map layer temporal properties for vector layers.
New in version 3.14.
QgsVectorLayerTemporalProperties(parent: QObject = None, enabled: bool = False) Constructor for
QgsVectorLayerTemporalProperties
, with the specifiedparent
object.The
enabled
argument specifies whether the temporal properties are initially enabled or not (seeisActive()
).Enums
alias of
VectorTemporalMode
Methods
Returns
True
if features will be accumulated over time (i.e.Creates a QGIS expression filter string for filtering features within the specified
context
to those within the specified timerange
.Returns the name of the duration field, which contains the duration of the event.
Returns the units of the event's duration.
Returns the expression for the end time for the feature's time spans.
Returns the name of the end datetime field, which contains the end time for the feature's time spans.
Returns the fixed duration length, which contains the duration of the event.
Returns the fixed temporal range for the layer.
Returns flags associated to the temporal property.
Attempts to setup the temporal properties by scanning a set of
fields
and looking for standard naming conventions (e.g.- param range:
Returns the temporal limit mode (to include or exclude begin/end limits).
Returns the temporal properties mode.
- param element:
Sets whether features will be accumulated over time (i.e.
- param capabilities:
Sets the name of the duration
field
, which contains the duration of the event.Sets the
units
of the event's duration.Sets the
expression
to use for the end time for the feature's time spans.Sets the name of the end datetime
field
, which contains the end time for the feature's time spans.Sets the fixed event
duration
, which contains the duration of the event.Sets a temporal
range
to apply to the whole layer.Sets the temporal
limit
mode (to include or exclude begin/end limits).Sets the temporal properties
mode
.Sets the
expression
to use for the start time for the feature's time spans.Sets the name of the start datetime
field
, which contains the start time for the feature's time spans.Returns the expression for the start time for the feature's time spans.
Returns the name of the start datetime field, which contains the start time for the feature's time spans.
- param element:
- TemporalMode¶
alias of
VectorTemporalMode
- accumulateFeatures(self) bool ¶
Returns
True
if features will be accumulated over time (i.e. all features which occur before or within the map’s temporal range should be rendered).Warning
This setting is only effective when
mode()
is QgsVectorLayerTemporalProperties.ModeFeatureDateTimeInstantFromFieldSee also
- Return type:
bool
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- createFilterString(self, context: QgsVectorLayerTemporalContext, range: QgsDateTimeRange) str ¶
Creates a QGIS expression filter string for filtering features within the specified
context
to those within the specified timerange
.The returned expression string considers the
mode()
and other related settings (such asstartField()
) when building the filter string.Warning
Note that ModeFixedTemporalRange is intentional NOT handled by this method and if
mode()
is ModeFixedTemporalRange then an empty string will be returned. UseisVisibleInTemporalRange()
when testing whether features from a layer set to the ModeFixedTemporalRange should ALL be filtered out.- Parameters:
context (QgsVectorLayerTemporalContext) –
range (QgsDateTimeRange) –
- Return type:
str
- customEvent(self, QEvent)¶
- disconnectNotify(self, QMetaMethod)¶
- durationField(self) str ¶
Returns the name of the duration field, which contains the duration of the event.
Units are specified by
durationUnits()
Warning
This setting is only effective when
mode()
is QgsVectorLayerTemporalProperties.ModeFeatureDateTimeStartAndDurationFromFieldsSee also
See also
- Return type:
str
- durationUnits(self) Qgis.TemporalUnit ¶
Returns the units of the event’s duration.
See also
- Return type:
- endExpression(self) str ¶
Returns the expression for the end time for the feature’s time spans.
Warning
This setting is only effective when
mode()
is QgsVectorLayerTemporalProperties.ModeFeatureDateTimeStartAndEndFromExpressionsSee also
See also
- Return type:
str
- endField(self) str ¶
Returns the name of the end datetime field, which contains the end time for the feature’s time spans.
See also
See also
- Return type:
str
- fixedDuration(self) float ¶
Returns the fixed duration length, which contains the duration of the event.
Units are specified by
durationUnits()
Warning
This setting is only effective when
mode()
is QgsVectorLayerTemporalProperties.ModeFeatureDateTimeInstantFromFieldSee also
See also
- Return type:
float
- fixedTemporalRange(self) QgsDateTimeRange ¶
Returns the fixed temporal range for the layer.
Warning
To be used only when
mode()
is QgsVectorLayerTemporalProperties.ModeFixedTemporalRangeSee also
- Return type:
- flags(self) QgsTemporalProperty.Flags ¶
Returns flags associated to the temporal property.
- Return type:
- guessDefaultsFromFields(self, fields: QgsFields)¶
Attempts to setup the temporal properties by scanning a set of
fields
and looking for standard naming conventions (e.g. “begin_date”).- Parameters:
fields (QgsFields) –
- isSignalConnected(self, QMetaMethod) bool ¶
- isVisibleInTemporalRange(self, range: QgsDateTimeRange) bool ¶
- Parameters:
range (QgsDateTimeRange) –
- Return type:
bool
- limitMode(self) Qgis.VectorTemporalLimitMode ¶
Returns the temporal limit mode (to include or exclude begin/end limits).
See also
New in version 3.22.
- Return type:
- mode(self) Qgis.VectorTemporalMode ¶
Returns the temporal properties mode.
See also
- Return type:
- readXml(self, element: QDomElement, context: QgsReadWriteContext) bool ¶
- Parameters:
element (QDomElement) –
context (QgsReadWriteContext) –
- Return type:
bool
- receivers(self, PYQT_SIGNAL) int ¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setAccumulateFeatures(self, accumulate: bool)¶
Sets whether features will be accumulated over time (i.e. all features which occur before or within the map’s temporal range should be rendered).
Warning
This setting is only effective when
mode()
is QgsVectorLayerTemporalProperties.ModeFeatureDateTimeInstantFromFieldSee also
- Parameters:
accumulate (bool) –
- setDefaultsFromDataProviderTemporalCapabilities(self, capabilities: QgsDataProviderTemporalCapabilities)¶
- Parameters:
capabilities (QgsDataProviderTemporalCapabilities) –
- setDurationField(self, field: str)¶
Sets the name of the duration
field
, which contains the duration of the event.Units are specified by
setDurationUnits()
Warning
This setting is only effective when
mode()
is QgsVectorLayerTemporalProperties.ModeFeatureDateTimeStartAndDurationFromFieldsSee also
See also
- Parameters:
field (str) –
- setDurationUnits(self, units: Qgis.TemporalUnit)¶
Sets the
units
of the event’s duration.See also
- Parameters:
units (Qgis.TemporalUnit) –
- setEndExpression(self, endExpression: str)¶
Sets the
expression
to use for the end time for the feature’s time spans.Warning
This setting is only effective when
mode()
is QgsVectorLayerTemporalProperties.ModeFeatureDateTimeStartAndEndFromExpressionsSee also
See also
- Parameters:
endExpression (str) –
- setEndField(self, field: str)¶
Sets the name of the end datetime
field
, which contains the end time for the feature’s time spans.See also
See also
- Parameters:
field (str) –
- setFixedDuration(self, duration: float)¶
Sets the fixed event
duration
, which contains the duration of the event.Units are specified by
setDurationUnits()
Warning
This setting is only effective when
mode()
is QgsVectorLayerTemporalProperties.ModeFeatureDateTimeInstantFromFieldSee also
See also
- Parameters:
duration (float) –
- setFixedTemporalRange(self, range: QgsDateTimeRange)¶
Sets a temporal
range
to apply to the whole layer. All features from the layer will be rendered whenever the current datetime range of a render context intersects the specifiedrange
.Warning
This setting is only effective when
mode()
is QgsVectorLayerTemporalProperties.ModeFixedTemporalRangeSee also
- Parameters:
range (QgsDateTimeRange) –
- setLimitMode(self, mode: Qgis.VectorTemporalLimitMode)¶
Sets the temporal
limit
mode (to include or exclude begin/end limits).See also
New in version 3.22.
- Parameters:
mode (Qgis.VectorTemporalLimitMode) –
- setMode(self, mode: Qgis.VectorTemporalMode)¶
Sets the temporal properties
mode
.See also
- Parameters:
mode (Qgis.VectorTemporalMode) –
- setStartExpression(self, expression: str)¶
Sets the
expression
to use for the start time for the feature’s time spans.Warning
This setting is only effective when
mode()
is QgsVectorLayerTemporalProperties.ModeFeatureDateTimeStartAndEndFromExpressionsSee also
See also
- Parameters:
expression (str) –
- setStartField(self, field: str)¶
Sets the name of the start datetime
field
, which contains the start time for the feature’s time spans.If
mode()
is ModeFeatureDateTimeInstantFromField, then this field represents both the start AND end times.See also
See also
- Parameters:
field (str) –
- startExpression(self) str ¶
Returns the expression for the start time for the feature’s time spans.
Warning
This setting is only effective when
mode()
is QgsVectorLayerTemporalProperties.ModeFeatureDateTimeStartAndEndFromExpressionsSee also
See also
- Return type:
str
- startField(self) str ¶
Returns the name of the start datetime field, which contains the start time for the feature’s time spans.
If
mode()
is ModeFeatureDateTimeInstantFromField, then this field represents both the start AND end times.See also
See also
- Return type:
str
- timerEvent(self, QTimerEvent)¶
- writeXml(self, element: QDomElement, doc: QDomDocument, context: QgsReadWriteContext) QDomElement ¶
- Parameters:
element (QDomElement) –
doc (QDomDocument) –
context (QgsReadWriteContext) –
- Return type:
QDomElement