PyQGIS : Displaying temporal raster layer in the temporal controller after having created temporalproperties

21 views Asked by At

I'm developping a QGIS plugin to convert data from hdf5 file. After having converted the data I want into raster, I load it into the interface with addRasterLayer. Then I do :

temporal_properties = layer.temporalProperties()
        temporal_properties.setMode(mode)
        # temporal_properties.setIsActive(True)
        
        start = date
        end = date
        temporal_properties.setFixedTemporalRange(QgsDateTimeRange(start - timedelta(minutes=self.pas_minutes/2), end + timedelta(minutes=self.pas_minutes/2)))
        temporal_properties.setIsActive(True)

It works well, but when I activate manually the temporal controller to show raster at the good time, it does not display anything. I have to go to the properties windows of my layer, click on apply to make it display. For one layer seems not too boring, but I will have many.

I didn't find any usefull info, I wonder if I forget something or if it's a QGIS bug.

(It's not working from QGIS 3.16, was working on 3.10).

If anyone could help... Thanks

Trying to display automatically a raster with temporal in the controller in QGIS. I've tried refresh canvas functions, updateTemporalRange for the QGIS controller.

0

There are 0 answers