QGIS rasters and temporal controller
The Wflow temporal rasters, which are NetCDFs with x, y and time dimensions, have always had poor support in QGIS, despite GDAL having support for time dimensions QGIS having the Temporal Controller. QGIS thinks that the time dimensions are bands and tries to assign the RGB fields to the first three layers. So it is not easy to visualize the rasters over time using the slider in the Temporal Controller.
There was a QGIS issue open about this: https://github.com/qgis/QGIS/issues/36251 But I just checked out the changelog of QGIS 3.44 and saw this: https://changelog.qgis.org/en/version/3.44/#rastertemporal-add-fixed-datetime-raster-temporal-
It turns out that it is now possible to get fast rasters over time in QGIS. It doesn't work well out of the box but I'll record the steps needed here. It might be nice to document these steps, or use this as a basis to further simplify this visualization and/or fund QGIS developments to improve this.
If you load the NetCDFs as a Mesh layer the Temporal Controller does work well out of the box, but it tends to load only some pixels, which is useless.
The result looks like this:
https://github.com/user-attachments/assets/5d25713d-82b1-4667-a7b5-c51718aecdc7
Here are the steps to visualize a NetCDF raster over time
- Load a NetCDF as a raster layer.
- Switch the symbology to a singleband visualization.
- In the temporal properties, enable Dynamic Temporal Control, and set to Fixed Time Range Per Band. The begin and end columns are not pre-filled, and need to computed. Click Calculate Beginning and then Calculate End. For beginning, the pre-filled expression is
make_datetime(2025,1,1,0,0,0) + make_interval(days:=@band), which is incorrect. Since I know the model starttime is July 20210, we do get a correct time withmake_datetime(2010,7,1,0,0,0) + make_interval(days:=@band). This is a bit hacky and it would be nice if this table could be automatically filled in correctly.
- Enable the Temporal Controller by clicking the clock, click "Set to Full Range", and see the raster updating smoothly as you slide the time slider.