Measuring area of raster classes?

I would use the following workflow to calculate the area within the classes:

  1. Reclassify (Spatial Analyst) the kernel density output to whichever classes you are using. By default ArcGIS creates a continuous raster surface for the kernel density output, but reclassifies the legend (which is temporary). Using the reclassify tool will make this permanent.
  2. Open the reclassified kernel density attribute table and observe the "COUNT" field (Figure 1). This is the count of all the pixels in each class. For example, Class 1 (Value = 1) has a count of 620,063 pixels. Since my coordinate system is UTM, the units are in meters and the pixels are at 1m spatial resolution. Therefore, Class 1 is 620,063 m^2.
  3. To convert the count to other units such as hectares, add a new field in the attribute table.
  4. Calculate field (Figure 2)
  5. Logic check the results by highlighting a class (Figure 3)

Figure 1

enter image description here

Figure 2

enter image description here

Figure 3

enter image description here


If you want an arcpy solution:

import numpy as np  #not sure how arcpy imports numpy

r = arcpy.RasterToNumPyArray('your raster name')

for val in np.unique(r):
    area = np.sum(r == val)  #multiply this by your pixel area
    print 'value ', val, ' : ', area

alternatively you can write the values to a csv/text file.