QGIS 3.14

Old version:

for i, layer in enumerate(QgsProject.instance().mapLayers().values()):
    if isinstance(layer, QgsRasterLayer):
        mode = QgsRasterLayerTemporalProperties.ModeFixedTemporalRange
        tprops = layer.temporalProperties()
        tprops.setFixedTemporalRange(QgsDateTimeRange(QDateTime(QDate(2020, 1, 1), QTime(1, i, 0, 0), Qt.UTC),
                                                   QDateTime(QDate(2020, 1, 1), QTime(1, 1+i, 0, 0), Qt.UTC)))

        tprops.setMode(mode)
        tprops.setIsActive(True)


https://github.com/Mariosmsk/qgis-python
0 forks.
0 stars.
0 open issues.
Recent commits:


1 Comment

Diego Flores · at

Hello, I want to know how to perform a time cut of a data set. I want these data that have different dates, stay for example, 14 days in a row, and then they stop showing up. In the attribute table, each point has a start date. As the data set is very extensive and is updated daily, I just want to tell the Temporal Controller how long the data will stay from the start date column. Do I do this in the “Expression” tool? How would it be?
Thank you!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: