Is there a way to save a raster's QgsRasterLayerTemporalProperties to a qml file using pyqgis?

I noticed that the temporal properties are also not included in the qml when manually saving the raster layer's style from Properties > Style > Save style..., so perhaps this is not possible at all?

1 Answer 1


I found out that the default method to save a style to qml ( my_layer.saveNamedStyle('path_to_qml_file') ) does also export the temporal properties to the file. However, due to a bug (as of QGIS 3.16), the temporal properties are not always loaded from the qml file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.