5. Zonal statistics with two raster layers

5.1. Style a discrete raster layer

Instead of the subcatchments layer we'll now use the rasterzones layer, which is also provided in the GeoPackage.

The rasterzones layer is a discrete raster where cells have a unique value for the subcatchment they belong to.

1. Make the rasterzones layer visible (check the box) and move it to the top of the Layers panel. You can easily move a layer to the top: click right on the layer name and choose Move to Top.

Let's style the rasterzones layer to make more sense out of it. Because it is a discrete raster, we need to use the Paletted/Unique values renderer, which will give each integer cell value a colour.

2. Select the rasterzones layer in the Layers panel and click to open the Layer Styling panel.

3. Choose Paletted/Unique values as the renderer.

4. To assign random colours to the classes in the raster, click Classify.


Now we're ready to calculate the zonal statistics.