I am evaluating a set of tax lots (polygons) to calculate how much land of each has a slope greater than 25%. Here's what I've done so far:
1. DEM raster to Slope raster
2. 'Greater Than' to produce a boolean raster based on Slope > 25.
I now need to count how many '1' cells (areas over 25% slope) from the boolean raster are within each tax lot polygon.
I tried using Zonal Statistics as Table tool with the tax lot polygons as zones, but there doesn't seem to be a way to count '1' cells versus '0' cells. It returns a total count of all cells. My next thought was to add a new field and calculate it with an if/then statement related to the stats that were generated, but I am not experienced with Python and can't seem to get the formula right. I was able to write this formula quickly in Excel, but I don't know how to translate it to Python. Also wondering if there is a better way to accomplish my goal.
The if/then statement I tried to write involves the following (in plain english), which would return the number of acres under 25% slope for each tax lot:
Zonal Statistics As Table. Statistic = SUM as sum of 1's == the count of 1's. Alternatively, SetNull with Slope <= 25, 1 then you'll have 1's and NoData so Zonal Stats count will be just of the 1's.