Starting from QGIS 3.14 TimeManager is dead, long live the Temporal Controller!
There are a lot of tutorials out there how "Temporal Controller" deals with vector layers, which looks nice. However, I'm working a lot with raster data and I cannot find any information, how to get a similar behaviour as it was in TimeManager.
I have a NetCDF like this:
ncdump -h SLA_ts.nc
netcdf SLA_ts {
dimensions:
time = 124 ;
lat = 5 ;
lon = 5 ;
variables:
char crs ;
crs:grid_mapping_name = "latitude_longitude" ;
crs:long_name = "CRS definition" ;
crs:semi_major_axis = 6378136.3 ;
crs:inverse_flattening = 298.257 ;
float time(time) ;
time:long_name = "time" ;
time:calendar = "standard" ;
time:units = "days since 1858-11-17 00:00:00.0" ;
time:actual_range = 52244., 55987.735625 ;
float lat(lat) ;
lat:standard_name = "latitude" ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
lat:actual_range = 53.8, 54.2 ;
float lon(lon) ;
lon:standard_name = "longitude" ;
lon:long_name = "longitude" ;
lon:units = "degrees_east" ;
lon:actual_range = 7.5, 7.9 ;
float sla(time, lat, lon) ;
sla:_FillValue = NaNf ;
sla:grid_mapping = "crs" ;
sla:long_name = "sea level anomaly" ;
sla:unit = "m" ;
// global attributes:
:Conventions = "CF-1.5" ;
}
When I load this file in QGIS, the time steps are loaded as bands (in the Symbology-Tab, they are displayed as Band 1: time=52244 (days since 1858-11-17 00:00:00)
and so on…). However, the Temporal-Tab offers only a fixed time range as shown in the screenshot:
I would expect that the Temporal Controller automatically recognizes that the layers are time steps but the button "Automatic" is inactive. Has anyone any experience with raster layers in "Temporal Controller"? How can I modify my data to be interpreted correctly? Or is this functionality simply not implemented (as the Temporal Controller is quite new)?
Best Answer
I wrote a PyQGIS script to handle the workaround for NetCDF files which uses temporal controller's
updateTemporalRange
signal. Just copy the following script to QGIS Python editor window, edit your dates, run the script and use Temporal Controller as usual.Here is a simple gif animation showing the usage: