I have two layers, flood area (flood.img) as a raster and flow direction as polygons. Would you please help me in calculating the number of pixels in each flow direction polygon? I want to get the percentage of flood area in each flow direction polygon. I use ArcGIS 10.
|
Using Zonal Statistics with "Input raster or feature zone data" is your flow direction polygon and Input value raster is the raster flood area. The output of this tool would be a raster with a field named COUNT, that's the number of pixels you need. |
|||||||
|
|
A solution will require several steps (each of them simple), but no scripting, looping or "model building" are required. As an intermediate result, we're aiming to build a table that counts pixels by flow direction within polygon. It will look something like this:
(Typically, flow directions are coded as powers of 2, {1,2,4,8,16,32,64,128}. The polygon identifiers can be anything.) With this table in hand, it is straightforward to sum the counts by polygon (a "summarize" operation), join the sum to the table (a "table join"), and divide each count by the polygon sum (using the Field Calculator): those are the desired proportions of each flow direction within each polygon. Let's focus on obtaining this table. One approach is to combine the flow direction and polygon grids. The new grid contains four fields: as usual, there is a "value" and "count" field; in addition, one field records the flow direction in the cell and the other records the polygon identifier. But that's precisely the table described above (with an additional "value" field, which goes unused). |
|||||
|