Select to view content in your preferred language

Some Zonal Statistics (Raster) outputs do not match Zonal statistics table values and are negative?

4118
12
07-20-2017 12:26 PM
KateBallard
New Contributor II

I have a county shapefile that I am using as the "zones" and a raster dataset of landcover types. I extracted each type of landcover, making it so that each one had an individual raster (so water raster, Deciduous forest raster etc). Then I performed the Zonal Statistic as Table tool and summed up the number of pixels of a certain type in each county. It seems to have worked correctly. Now I am trying to use the Zonal Statistics tool to give me an output raster that represents those same SUM values, but it seems that some of the outputs for certain zones are wrong. There are some zones (counties) that match their SUM values in the original Zonal table, and then some that are negative and do not match their value in the table.

For example, when I use the Identify tool and click on the county (zone) #27071 it tells me that the value for the SUM generated by the Zonal Statistics tool was -739109312.0. I checked to see what the Zonal Statistics as TABLE tool assigned as the SUM value for county #27071 and it was 1770032 (completely different). This number should not be negative to begin with, and I checked to make sure the original raster didn't have a value like -999 assigned to it for "No Data" cells, and it did not (it actually had nothing assigned for No Data). In addition, I told the tool to ignore No Data cells. This happened for multiple counties. 

However, some of the counties did match the original Zonal Table SUM values, so it seems like the tool is doing something weird for only some of the zones? 

Does anyone have any idea what could be going on? 

Thank you very much for your help, 

Kate 

12 Replies
XanderBakker
Esri Esteemed Contributor

Hi James Zack 

Just did a test with the maximum value of the straight line on the raster with 127 and 128, and as you described the result is a negative value in case of value 128:

In ArcGIS Pro I did something similar for the raster with 128 and for each case (point, lines, poligons, etc) the result of maximum is -128:

Please report this to Esri support.

CC KKramer-esristaff 

0 Kudos
KoryKramer
Esri Community Moderator

Xander and James Zack

It looks like we have the issue logged: BUG-000108977: The Zonal Statistics tool returns incorrect data.

Notes in that bug indicate this is reproducible in ArcMap 10.5.1 and ArcGIS Pro 2.0.1.

The development team is aware of the issue and will work to get it fixed as soon as possible.

Thank you.

XanderBakker
Esri Esteemed Contributor

Thanks KKramer-esristaff !

0 Kudos