QGIS Raster Analysis – How to Split a Single Raster Layer into Multiple Layers Based on Raster Values in QGIS

qgisrasterzonal statistics

I am working with a raster layer in QGIS, and within this layer, the raster values are as follows: 10, 11, 12, 13, 21, 22, 23, and 30. I need the number of pixel of each value in city borders. I have a vector layer for cities.

Raster layer unique values report is useful but I need a city by city statistics like zonal statistics. I thought that by splitting each value as a different raster than I can use zonal statistics. Do you know an easier method for that? And do you know how can I split the pixels with specific band values as a different raster?

Best Answer

You dont need to split your raster. Zonal Histogram will create a column for each pixel value with the pixel count.

Appends fields representing counts of each unique value from a raster layer contained within polygon features.

enter image description here

Related Question