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:


Leave a Reply

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

%d bloggers like this: