I am working on a one-band raster with pixel values from 1 to 7, each representing a land-use class. I also have a grid of polygons and what I need is to obtain the percentage of each class in each cel of the grid. I already used the Zonal Statistics tool and with rasters representing only one variable each it adds three columns to the attribute table of the grid: count of values, sum and average. If I do the same with the land-use raster, I only obtain the same count, sum and average values but only for the overall pixels with no distinction for the classes.

I hope is clear enough.

Many thanks

  • A zonal majority would solve my problem I think! – Daniele De Angelis Oct 6 '14 at 23:15

I don't know about QGIS, but in ArcMap you could use Extract Values To Table (Geostatistical Analyst)

You simply give the grid .shp and land-use class raster and the results is a table with unique values within each cell. All you have to do is to calculate the counts and percentages, preferably in R or some other statistical software (or by hand if you don't have lots of data).

I tested this with 250 x 250 m grid with Finnish National Corine data (25 m resolution) in a 7,5 x 5,75 km area. That gives a whopping 69000 observations, so if you're working on big data or at finer resolution some other solution might be better than this. Each of my grid cell has 100 land use class pixels, here is an example:

enter image description here

  • Thanks, I am looking for something like that, but apparently it is not in the basic qgis tools. – Daniele De Angelis Oct 10 '14 at 7:22
  • No prob. I'd like to know about this in QGIS too :) – reima Oct 10 '14 at 11:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.