How to calculate the number of pixels

5826
5
05-02-2012 08:20 PM
HuongNhan
New Contributor
I have two layers, one is the flood area in raster format, the other is flow direction in polygon (vector format). Would you please show me how to calculate the area of flood in each polygon of flow direction?  Or how can I calculate the number of pixel in each polygon.
Thank you so much. I am looking forward to getting your help.
0 Kudos
5 Replies
JeffreySwain
Esri Regular Contributor
You could use the Zonal Statistics as a table tool to obtain many statistics about the polygons based on the underlying raster.  You can then take the table and join it back to the polygon feature class.
0 Kudos
HuongNhan
New Contributor
Dear Jbswain,

Thank you for your help.  Please show me how to join the Zone Statistic Table back to the polygon feature class. Because the table taken just counted for each flow direction (1,2,4,8,16,32,64,128) not for each polygon.
My flood raster layer (I made from Erdas imagine), its attribute Value 1: flood, 0: non flood,
[ATTACH=CONFIG]14090[/ATTACH]
My polygon layer:
[ATTACH=CONFIG]14091[/ATTACH]
After run zonal statistic Table, the table showed as follow:
[ATTACH=CONFIG]14092[/ATTACH]
From those, I do not know how to calculate the area of flood per each polygon in flow direction layer. Would you please explain for me?
Thanks
0 Kudos
JeffreySwain
Esri Regular Contributor
For the Zone field what did you select? ID or Gridcode? Also for your Flood layer, is the value the corresponding field from the original polygon or should that be the 'pixel' field?  In my thought process the value raster will be a continuous raster with the flood data as the value.  It appears that the actual value that is being surveyed in your analysis is the id from the original polygon.  What I would recommend is to use the Lookup tool to create a new raster based on the 'pixel' field if that is the one that you desire.  From there, you can join the table created with the polygon 'zone' feature class with the key field being the 'zone' field. The output will be based on that zone and will have the inundation value in the pixel field as being surveyed.
0 Kudos
HuongNhan
New Contributor
Dear Jbswain,

Thank you so much for your help. I have gotten the result under your guider.
Wish you have a nice day and always willing to support us when we get difficult. 😄
0 Kudos
JeffreySwain
Esri Regular Contributor
No problem.  The only comment I have is that if you like the answer or feel that the post warrants recognition, do not forget to vote up on the right side or mark the question as answered when you have one.  I am glad that it worked out for you.
0 Kudos