How To: Determine percentage of a specified cell value within a defined neighborhood
Steps for finding the percentage of a particular cell value within a defined focal neighborhood.
- Create an intermediate grid with values of 1 where the input grid meets your desired condition, and 0 or NODATA everywhere else.
- Use the FOCALSUM function, with the DATA option on the intermediate grid, to determine the number of cells in the focal neighborhood that have a value of 1.
- Divide the sum by the number of cells in the focal neighborhood for the percentage.
PERCENTAGE_GRID = FOCALSUM( con( <input_grid> == <value>, 1 ), RECTANGLE, 3, 3, DATA) / 9
The above example nests the three steps into one expression, which determines the percentage of <value> within a 3 by 3 focal area containing 9 cells.
Last Published: 5/5/2016
Article ID: 000002535
Software: ArcGIS-ArcInfo 8.0.2, 8.0.1 ArcInfo Workstation 7.2.1, 7.1.2, 7.1.1, 7.0.4