4

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?

EikeMike
  • 1,171
  • 10
  • 24
  • Can you provide an example (screenshot) of the attribute table of your raster? My guess is that this can be done with python, using cursors. – Delonix R. Jun 20 '16 at 12:29
  • I see your point. I have no attribute table available. Probably due to the floating point raster. Maybe this is my problem. – EikeMike Jun 20 '16 at 12:33
  • You can still classify ranges in your raster, either using python or the "Field Calculator". – Delonix R. Jun 20 '16 at 13:08
  • In arcgis use raster calculator int(). Result will have a table – FelixIP Jun 20 '16 at 20:02
  • By asking how to do this in two desktop GIS products you are effectively asking two questions which goes against the [Tour]. If you focus your question on one product or other then I think it should be possible to re-open and be more liakely to attract a potential answerer. – PolyGeo Sep 24 '16 at 22:35

1 Answers1

2

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.

BERA
  • 72,339
  • 13
  • 72
  • 161