TransWikia.com

Zonal statistics per raster category in QGIS?

Geographic Information Systems Asked on November 16, 2021

I have a raster layer of land use and a vector layer of areas of interest.

I would like to calculate for each polygon (areas of interest) the proportion or number of cells of the raster, for each category. I would like to get a table of areas in rows, raster categories in columns and the number/proportion of cell for each combination.

I’m sure there is an easy way to do that but I couldn’t find it. All I got was global statistics through Zonal Stats but I couldn’t calculate per category.

One Answer

Update:

As of QGIS 3.2, there is the Zonal Histogram tool which should perform this automatically, saving the need to create multiple indicator grids (see original answer).


Original answer:

I had a very similar situation, and came across https://gis.stackexchange.com/a/81047/16141

Essentially, you have to create an indicator grid of 0s and 1s for each of your land use types. And then use a combination of Count and Sum from the Zonal Statistics plugin. Count will give total number of raster cells in each polygon, and Sum will give number of cells = 1. You can then determine proportion of cover within each polygon. Maybe a bit cumbersome if you have a lot of land use types, but straightforward.


Answered by EcologyTom on November 16, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP