How can you count pixels in a raster by value?

12020
11
02-06-2013 11:09 AM
EmmaYoung
New Contributor
Hi-

I have a raster file classified into 5 values (1-5, zero being no data), with points overlaid in a shapefile.

What I'm trying to do is, within a 2 km buffer around each of these points, count the number of pixels of each value. I've attached a photo. I'm pretty new to Arc, but what I've done so far is use the Zonal tool in the spatial analyst toolbox to export the zonal statistics to a table, with the "input feature zone data" being the buffer shapefile, and the "input value raster" being the underlying raster file containing the pixel values.

From here, I think I need to just add a column to the resulting stat table and have it calculate the number of pixels of each value, but I don't know how to do that.

Any help would be extremely appreciated! I hope all that made sense.

Cheers,
Emma
0 Kudos
11 Replies
EmmaYoung
New Contributor
Eric-

Thanks for your help. I think I've fixed the GRID format issues, but a lot of the other things in modelbuilder are way over my head/skill level, leaving me beyond the help of ArcGIS Help. Do you know of any good tutorials for any of these processes? Thanks again.

Emma
0 Kudos
EmmaYoung
New Contributor
Hi Eric-

I fixed the GRID formatting, and I think I have the work flow figured out... I've attached a .jpg of my workflow, the more complex one being the sub-model. I'm running it all now, so we'll see if it works.

In terms of inline variables, I used them as shown in the second .jpg, as part of the Zonal Histogram output, along with the in-memory workspace... I'm not certain if this is correct. Lastly i'm not certain of how to use "join"... is this a necessary step? Thanks so much for your help.

Emma
0 Kudos