I have been working with some rasters and would like to know how to calculate the area occupied by one element of a raster in QGIS?
-
1What do you mean by "element"? A cell? An area of same value? – underdark Feb 19 '13 at 20:31
-
1area with the same value :) – Nadia Feb 19 '13 at 20:39
3 Answers
with 3 steps you can achieve what you want:
- Vectorize raster based on the values you want to calculate
- Open your new vector, and create a new column. Name it 'Area'.
- Use the field calculator to populate the column with the variable
$area
- 11,519
- 3
- 42
- 75
The method of Vectorization gives a cluster based measure of the area rather than a pixel based area. If you were to calculate a specified area or the area of a feature this works just fine. While running the Raster to Vector option ,it identifies the adjacent pixels and groups it and then creates a vector of it. The total count in the image could be confusing here. These methods could also be helpful for calculating the area. What are the methods for calculating area from a raster in QGIS
- 41
- 1
- 4
I'm assuming you just need to know the area occupied by each value. You can get this value by getting the statistics per value for the raster. Specifically, you want the total number of cells with a particular value. Once you have those totals, you can just multiply them with the cell size of your raster to get the area.
- 17,405
- 3
- 59
- 110
-
3Remembering that cell size is the square of the cell width...a common mistake since most GIS packages report cell width rather than cell area. – Apr 09 '13 at 13:49
-
1This is only true if the raster is in a scale small enough that the areas of all cells are roughly equal. – Anaphory Nov 26 '19 at 12:52
-
@Anaphory it's not (always?) a matter of scale. I've just converted a raster from Degrees to Meters, and pixels on 0 and 37.5 latitude had exactly the same width. – Rodrigo Nov 11 '23 at 00:48
-