QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
|
Implementation of map layer temporal properties for vector layers. More...
#include <qgsvectorlayertemporalproperties.h>
Public Member Functions | |
QgsVectorLayerTemporalProperties (QObject *parent=nullptr, bool enabled=false) | |
Constructor for QgsVectorLayerTemporalProperties, with the specified parent object. | |
bool | accumulateFeatures () const |
Returns true if features will be accumulated over time (i.e. | |
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. | |
QString | createFilterString (const QgsVectorLayerTemporalContext &context, const QgsDateTimeRange &range) const |
Creates a QGIS expression filter string for filtering features within the specified context to those within the specified time range. | |
QString | durationField () const |
Returns the name of the duration field, which contains the duration of the event. | |
Qgis::TemporalUnit | durationUnits () const |
Returns the units of the event's duration. | |
QString | endExpression () const |
Returns the expression for the end time for the feature's time spans. | |
QString | endField () const |
Returns the name of the end datetime field, which contains the end time for the feature's time spans. | |
double | fixedDuration () const |
Returns the fixed duration length, which contains the duration of the event. | |
const QgsDateTimeRange & | fixedTemporalRange () const |
Returns the fixed temporal range for the layer. | |
QgsTemporalProperty::Flags | flags () const override |
Returns flags associated to the temporal property. | |
void | guessDefaultsFromFields (const QgsFields &fields) |
Attempts to setup the temporal properties by scanning a set of fields and looking for standard naming conventions (e.g. | |
bool | isVisibleInTemporalRange (const QgsDateTimeRange &range) const override |
Returns true if the layer should be visible and rendered for the specified time range. | |
Qgis::VectorTemporalLimitMode | limitMode () const |
Returns the temporal limit mode (to include or exclude begin/end limits). | |
Qgis::VectorTemporalMode | 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 | setAccumulateFeatures (bool accumulate) |
Sets whether features will be accumulated over time (i.e. | |
void | setDefaultsFromDataProviderTemporalCapabilities (const QgsDataProviderTemporalCapabilities *capabilities) override |
Sets the layers temporal settings to appropriate defaults based on a provider's temporal capabilities. | |
void | setDurationField (const QString &field) |
Sets the name of the duration field, which contains the duration of the event. | |
void | setDurationUnits (Qgis::TemporalUnit units) |
Sets the units of the event's duration. | |
void | setEndExpression (const QString &endExpression) |
Sets the expression to use for the end time for the feature's time spans. | |
void | setEndField (const QString &field) |
Sets the name of the end datetime field, which contains the end time for the feature's time spans. | |
void | setFixedDuration (double duration) |
Sets the fixed event duration, which contains the duration of the event. | |
void | setFixedTemporalRange (const QgsDateTimeRange &range) |
Sets a temporal range to apply to the whole layer. | |
void | setLimitMode (Qgis::VectorTemporalLimitMode mode) |
Sets the temporal limit mode (to include or exclude begin/end limits). | |
void | setMode (Qgis::VectorTemporalMode mode) |
Sets the temporal properties mode. | |
void | setStartExpression (const QString &expression) |
Sets the expression to use for the start time for the feature's time spans. | |
void | setStartField (const QString &field) |
Sets the name of the start datetime field, which contains the start time for the feature's time spans. | |
QString | startExpression () const |
Returns the expression for the start time for the feature's time spans. | |
QString | startField () const |
Returns the name of the start datetime field, which contains the start time for the feature's time spans. | |
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. | |
virtual QList< QgsDateTimeRange > | allTemporalRanges (QgsMapLayer *layer) const |
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. | |
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< Flag > | Flags |
Signals inherited from QgsTemporalProperty | |
void | changed () |
Emitted when the temporal properties have changed. | |
Implementation of map layer temporal properties for vector layers.
Definition at line 69 of file qgsvectorlayertemporalproperties.h.
QgsVectorLayerTemporalProperties::QgsVectorLayerTemporalProperties | ( | QObject * | parent = nullptr , |
bool | enabled = false |
||
) |
Constructor for QgsVectorLayerTemporalProperties, with the specified parent object.
The enabled argument specifies whether the temporal properties are initially enabled or not (see isActive()).
Definition at line 26 of file qgsvectorlayertemporalproperties.cpp.
bool QgsVectorLayerTemporalProperties::accumulateFeatures | ( | ) | const |
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).
Definition at line 376 of file qgsvectorlayertemporalproperties.cpp.
|
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.
Reimplemented from QgsMapLayerTemporalProperties.
Definition at line 51 of file qgsvectorlayertemporalproperties.cpp.
QString QgsVectorLayerTemporalProperties::createFilterString | ( | const QgsVectorLayerTemporalContext & | context, |
const QgsDateTimeRange & | range | ||
) | const |
Creates a QGIS expression filter string for filtering features within the specified context to those within the specified time range.
The returned expression string considers the mode() and other related settings (such as startField()) when building the filter string.
Definition at line 446 of file qgsvectorlayertemporalproperties.cpp.
QString QgsVectorLayerTemporalProperties::durationField | ( | ) | const |
Returns the name of the duration field, which contains the duration of the event.
Units are specified by durationUnits()
Definition at line 416 of file qgsvectorlayertemporalproperties.cpp.
Qgis::TemporalUnit QgsVectorLayerTemporalProperties::durationUnits | ( | ) | const |
Returns the units of the event's duration.
Definition at line 426 of file qgsvectorlayertemporalproperties.cpp.
QString QgsVectorLayerTemporalProperties::endExpression | ( | ) | const |
Returns the expression for the end time for the feature's time spans.
Definition at line 366 of file qgsvectorlayertemporalproperties.cpp.
QString QgsVectorLayerTemporalProperties::endField | ( | ) | const |
Returns the name of the end datetime field, which contains the end time for the feature's time spans.
Definition at line 406 of file qgsvectorlayertemporalproperties.cpp.
double QgsVectorLayerTemporalProperties::fixedDuration | ( | ) | const |
Returns the fixed duration length, which contains the duration of the event.
Units are specified by durationUnits()
Definition at line 386 of file qgsvectorlayertemporalproperties.cpp.
const QgsDateTimeRange & QgsVectorLayerTemporalProperties::fixedTemporalRange | ( | ) | const |
Returns the fixed temporal range for the layer.
Definition at line 255 of file qgsvectorlayertemporalproperties.cpp.
|
overridevirtual |
Returns flags associated to the temporal property.
Reimplemented from QgsTemporalProperty.
Definition at line 245 of file qgsvectorlayertemporalproperties.cpp.
void QgsVectorLayerTemporalProperties::guessDefaultsFromFields | ( | const QgsFields & | fields | ) |
Attempts to setup the temporal properties by scanning a set of fields and looking for standard naming conventions (e.g.
"begin_date").
Definition at line 610 of file qgsvectorlayertemporalproperties.cpp.
|
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 qgsvectorlayertemporalproperties.cpp.
Qgis::VectorTemporalLimitMode QgsVectorLayerTemporalProperties::limitMode | ( | ) | const |
Returns the temporal limit mode (to include or exclude begin/end limits).
Definition at line 233 of file qgsvectorlayertemporalproperties.cpp.
Qgis::VectorTemporalMode QgsVectorLayerTemporalProperties::mode | ( | ) | const |
Returns the temporal properties mode.
Definition at line 221 of file qgsvectorlayertemporalproperties.cpp.
|
overridevirtual |
Reads temporal properties from a DOM element previously written by writeXml().
Implements QgsMapLayerTemporalProperties.
Definition at line 260 of file qgsvectorlayertemporalproperties.cpp.
void QgsVectorLayerTemporalProperties::setAccumulateFeatures | ( | bool | accumulate | ) |
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).
Definition at line 381 of file qgsvectorlayertemporalproperties.cpp.
|
overridevirtual |
Sets the layers temporal settings to appropriate defaults based on a provider's temporal capabilities.
Implements QgsMapLayerTemporalProperties.
Definition at line 333 of file qgsvectorlayertemporalproperties.cpp.
void QgsVectorLayerTemporalProperties::setDurationField | ( | const QString & | field | ) |
Sets the name of the duration field, which contains the duration of the event.
Units are specified by setDurationUnits()
Definition at line 421 of file qgsvectorlayertemporalproperties.cpp.
void QgsVectorLayerTemporalProperties::setDurationUnits | ( | Qgis::TemporalUnit | units | ) |
Sets the units of the event's duration.
Definition at line 431 of file qgsvectorlayertemporalproperties.cpp.
void QgsVectorLayerTemporalProperties::setEndExpression | ( | const QString & | endExpression | ) |
Sets the expression to use for the end time for the feature's time spans.
Definition at line 371 of file qgsvectorlayertemporalproperties.cpp.
void QgsVectorLayerTemporalProperties::setEndField | ( | const QString & | field | ) |
Sets the name of the end datetime field, which contains the end time for the feature's time spans.
Definition at line 411 of file qgsvectorlayertemporalproperties.cpp.
void QgsVectorLayerTemporalProperties::setFixedDuration | ( | double | duration | ) |
Sets the fixed event duration, which contains the duration of the event.
Units are specified by setDurationUnits()
Definition at line 391 of file qgsvectorlayertemporalproperties.cpp.
void QgsVectorLayerTemporalProperties::setFixedTemporalRange | ( | const QgsDateTimeRange & | range | ) |
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 specified range.
Definition at line 250 of file qgsvectorlayertemporalproperties.cpp.
void QgsVectorLayerTemporalProperties::setLimitMode | ( | Qgis::VectorTemporalLimitMode | mode | ) |
Sets the temporal limit mode (to include or exclude begin/end limits).
Definition at line 238 of file qgsvectorlayertemporalproperties.cpp.
void QgsVectorLayerTemporalProperties::setMode | ( | Qgis::VectorTemporalMode | mode | ) |
Sets the temporal properties mode.
Definition at line 226 of file qgsvectorlayertemporalproperties.cpp.
void QgsVectorLayerTemporalProperties::setStartExpression | ( | const QString & | expression | ) |
Sets the expression to use for the start time for the feature's time spans.
Definition at line 361 of file qgsvectorlayertemporalproperties.cpp.
void QgsVectorLayerTemporalProperties::setStartField | ( | const QString & | field | ) |
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.
Definition at line 401 of file qgsvectorlayertemporalproperties.cpp.
QString QgsVectorLayerTemporalProperties::startExpression | ( | ) | const |
Returns the expression for the start time for the feature's time spans.
Definition at line 356 of file qgsvectorlayertemporalproperties.cpp.
QString QgsVectorLayerTemporalProperties::startField | ( | ) | const |
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.
Definition at line 396 of file qgsvectorlayertemporalproperties.cpp.
|
overridevirtual |
Writes the properties to a DOM element, to be used later with readXml().
Implements QgsMapLayerTemporalProperties.
Definition at line 294 of file qgsvectorlayertemporalproperties.cpp.