1

I am using ArcGIS Pro 10.2.9.

I have a raster. I used a polygon feature class (19 rows of data) to clip the raster into 19 distinct areas, some of which abut each other. I classified the clipped raster into three classes.

Now I want to calculate the number of pixels per class, for each of the areas/zones.

Integerizing the raster produces an associated attribute table that tells me the total number of pixels for each class, but for the entire raster and not by zone.

I tried using Zonal Statistics As Table, but I get pixel counts per zone, and not by class within each zone.

The table I expect could be 57 rows, three rows per zone for each class with a pixel count column; or 19 rows, with at least three columns referring to pixel counts for each class (px_count_class1, px_count_class2, px_count_class3).

3
  • Would Tabulate Area resources.arcgis.com/en/help/main/10.2/index.html#/… be a better choice of tool for this? The zone data can be a feature class which sounds like what you're after. Full disclosure: I haven't used this tool before, I've only heard of it in passing. If that doesn't work then you might need to use a model/script to iterate the zones using Zonal Statistics as Table on each iteration for a total of 19 tables. Sep 28, 2022 at 2:50
  • Thank you Michael Stimson, that's exactly what I was looking for! It gives me pixel count and area given the spatial resolution.
    – USJoeS
    Sep 28, 2022 at 13:50
  • That's great news, now can you please answer your own question, with screen grabs, for the benefit of future users. Sep 28, 2022 at 23:42

1 Answer 1

0

As suggested by Michael Stimson, 'Tabulate Area' was the appropriate tool for my task.

I could not use my original classified raster, but needed to first use 'Int' to integerize it. My feature zone data contained 19 polygon features (most singlepart, some multipart), with my 'SITE' variable as the zone field. I originally used these features to clip my raster before classifying it. The data with my classes was the integerized, classified raster, with 'Value' as my Class field. Because I planned to create a bar plot from the resulting data, I wanted long form data, so checked 'Classes as rows in output table'. My output was a table with a 'ZONE_CODE' for each site (referring to each of the 19 polygon features), the value of each class, pixel count, and area which is pixel count multiplied by spatial resolution (0.6m x 0.6m).

I forgot I had increased the size of some of my polygons, so the '255' is unspecified class, or the portion of the slightly larger polygon not filled by the raster. To avoid this, use the version of polygon feature used to originally clip the raster. a cropped version of the output with sites blurred

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.