I am unable to run Zonal Statistics as table successfully and getting the unknown error 99999. I don't know what is going wrong. I am attaching the shapefile and the raster I am using. If someone can let me know what is going wrong, I will be very grateful.
since the *.tif is a bit beefy, can you answer whether...
Thanks for your reply. To answer your questions -
1. Yes, both the tif and the shapefiles are in the same coordinate system - WGS 1984
2. I tried by turning off background processing.
3. The polygons are only 10 in number. This is a subset of some 3 million polygons of building volumes.
The extents are not set to overlapping in the Zonal statistics as Table tools.
It failed. Did not work.
If you have any other suggestions, please do let me know.
I have created the cell center and cell boundaries from the value raster and have overlaid the zone polygons (in blue) on it in the figure below.
To perform the zonal operation, the zone polygon is first converted to a raster zone using the cell size of the value raster by default. In this case, the zone does not get internally converted due to the combination of how the zones are located and the analysis cell size. So, internally, the zone raster does not contain any valid zone and the tool returns an error as expected. To know more about Zonal Statistics as Table and how conversion in Zonal tools work, check out the help doc How Zonal Statistics works and see this blog on Getting the most out of Zonal Statistics.
In the future, instead of returning 99999 error message, we will try to provide a better error message.
Now, let me explain when your polygon zone were converted into raster zones internally, why the internal zone raster does not contain any valid zone:
The zone polygon is converted to a raster zone internally, using the cell center method (the polygons that overlaps the cell center of the value raster are the only ones to get converted). Since none of your zones overlapped any cell center of the value raster (default cell size is determined from value raster), the zones did not get converted. See How Polygon To Raster works to learn more about conversion.
To perform Zonal Statistics as Table tool with such small zones, set the analysis cell size from the environment of the Zonal Statistics as Table tool to a smaller number like 0.00001 so that the polygons are successfully rasterized and turned into valid zones. Keep in mind that specifying a smaller cell size, will generate a larger output raster. The higher resolution output may give the wrong perception of a higher quality result than what it actually is, since the additional detail does not actually exist in the input value raster.
Hope that helps. If you have more questions on zonal tools, you can contact me here or email me at firstname.lastname@example.org
Thanks so much for your detailed reply. I had stopped working on the project and have come back to it again.
I am trying to extract the raster values by overlaying the polygons (3 million plus) by writing a python script using zonal statistics. I have set the environment variables this way in the code -
# Set the cell size environment using a number.
arcpy.env.cellSize = 0.00001
Am I correct in understanding your suggestion?
Please let me know what you think.