[GIS] How to calculate raster area or number of cells for multiple classes in a raster

qgisraster

I have a raster with many classes and I want to know the area or the number of cells for each class.
I found quite a few posts on this topic (see links below). None of the suggestions matched my wishes. I do not want to convert to vector since my raster is fairly big. I am looking for a tool similar to the summarize functions available for vector data, with a table as output.

The raster is a 32bit float tif with 5 unique values (1.0, 2.0, 3.0, 4.0 and 5.0) as classes as a result of classification with QGIS SAGA-Toolbox.

QGIS solutions are preferred. Related posts:

Calculating raster area?

Calculating area of vegetation in raster file?

Calculating area of rasters in QGIS?

Best Answer

You can use GRASS GIS r.stats as a plugin in QGIS or in stand alone GRASS:

r.stats calculates the area present in each of the categories of user-selected raster map layer(s). Area statistics are given in units of square meters and/or cell Counts

If you need more options like different units use r.report:

r.report allows the user to set up a series of report parameters to be applied to a raster map layer, and creates a report.

Related Question