Select to view content in your preferred language

How to count number of pixels which intersect the polygon?

4826
2
Jump to solution
09-29-2016 11:48 PM
KarolinaKorzeniowska
Deactivated User

I have around 300 polygons and a raster data set for the same area. I would like to know how many pixels on raster data set are intersected by every individual area. Is there an easy way to do this? I know that I can convert my Raster to Point data set and that using Select by Location count the points, but I would like to avoid this, because my raster has 50000 x 50000 pixels, so it will take long time.

0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Emeritus

if you are using a raster data, why not use some of the spatial analyst tools 

Tabulate Area—Help | ArcGIS for Desktop  is one obvious choice

since you are working with zonal data, look at tools specifically designed for them.  This outputs statistical information in tabular form, but there are other tools as well

Zonal Statistics as Table—Help | ArcGIS for Desktop 

View solution in original post

2 Replies
DanPatterson_Retired
MVP Emeritus

if you are using a raster data, why not use some of the spatial analyst tools 

Tabulate Area—Help | ArcGIS for Desktop  is one obvious choice

since you are working with zonal data, look at tools specifically designed for them.  This outputs statistical information in tabular form, but there are other tools as well

Zonal Statistics as Table—Help | ArcGIS for Desktop 

curtvprice
MVP Esteemed Contributor

Hi Karolina,

Try this:

  1. Open the Polygon To Raster or Feature To Raster tool, select the Environments button to set the coordinate system, extent and snap raster to your raster dataset. Choose ObjectID for the Value field. 
  2. The output raster will have two fields Value and Count. Value and Count are auto-created for raster attribute tables, much like polygon tables have Shape_Area and Shape_Perimeter. Count is the number of cells in each polygon. Done!