Zonal statistics mean VS Field statistics mean, which is correct?

2013
3
Jump to solution
11-24-2016 08:12 AM
SalmanAhmed3
New Contributor III

I calculated mean from a raster for a single polygon using zonal statistics as table tool and got the mean as 440000. The raster is the exact same shape as the polygon (used extract by mask tool for this). When I open the attribute table of this raster and do field statistics on the value field, I see that the mean is 330000. How is this possible? Shouldnt the two means be same if not exactly same? Any ideas why this is happening? This is big problem because I want to know which one is correct.

0 Kudos
1 Solution

Accepted Solutions
SalmanAhmed3
New Contributor III

I wrote 'value field' in the question already. 

I just realised that its wrong to do a field statistic for mean on this value field because this value field in the raster attribute table does not show the values of all the cells in that raster. It shows only all the unique values with the cell count being shown in the 'count field'. So cannot expect to calculate mean from here by just doing field statistics. So I guess my question is answered. Using the zonal statistics tool is the right way. Thanks!

View solution in original post

3 Replies
DanPatterson_Retired
MVP Emeritus

What field in the raster table? the count field? value field?  what is the cell area?

SalmanAhmed3
New Contributor III

I wrote 'value field' in the question already. 

I just realised that its wrong to do a field statistic for mean on this value field because this value field in the raster attribute table does not show the values of all the cells in that raster. It shows only all the unique values with the cell count being shown in the 'count field'. So cannot expect to calculate mean from here by just doing field statistics. So I guess my question is answered. Using the zonal statistics tool is the right way. Thanks!

curtvprice
MVP Esteemed Contributor

Thought I'd just point out: If it's just a single polygon the value is also available in the raster properties (arcpy.sa.Raster(myraster).mean) or from the Get Raster Properties tool. Either of those methods are likely to give you more precision because Zonal Statistics is limited to 32-bit float results, not Double -- for historical reasons.

0 Kudos