Zonal Statistics as Table on Model Builder!!!

5286
25
Jump to solution
07-23-2013 11:13 AM
ShikoNjuno
Occasional Contributor
So I have a model that utilizes the Zonal Statistics as a Table tool and it runs beautifully. However, the output is incredibly false.

The input feature zone data is a shapefile comprised of a select few polygons.
The zone field selected is FID.
The input value raster is a .tiff file which stores the correct values for the output.
The output table is saved to the workspace chosen by user.
And the statistic performed is the MEAN. Which means the output for every FID row is an average of all pixel values in the raster file within that polygon shape.

What's happening when the model runs is that the output is just incorrect....almost like there is no zonal recognition happening.
Is anyone familiar with this and perhaps what I can do to make the output correct??
Thanks
0 Kudos
25 Replies
ShikoNjuno
Occasional Contributor
The cell size 60  * 60--it is 3600 sq. I don't know your purpose, but it is so big.
You may set it as 1*1, then the return may fit your expectation.
The Cell Assignment method doesn't affect your  result but cell size.
If the cell size is too small, the tool doesn't work sometimes. You need to try.


You know you were right about the smaller cell size in this case.
I tried 30 *30 and my output was closer to what it should be. I'm working on a 10 * 10 raster at the moment. It's taking quite a while to create the layer but it's definitely worth a shot.....and the wait 🙂
0 Kudos
TOMKONG
Occasional Contributor II
You know you were right about the smaller cell size in this case.
I tried 30 *30 and my output was closer to what it should be. I'm working on a 10 * 10 raster at the moment. It's taking quite a while to create the layer but it's definitely worth a shot.....and the wait 🙂


Interesting things is why you are using MEAN value for landuse code(?)? Want to see the changes after year by year?
0 Kudos
ShikoNjuno
Occasional Contributor
Interesting things is why you are using MEAN value for landuse code(?)? Want to see the changes after year by year?


No...the MEAN is supposed to take the average of all the raster pixels within the corresponding polygon. Here's a snapshot of what I'm working on (Note: has been revised):
[ATTACH=CONFIG]26185[/ATTACH]

At this point I'm pretty sure my problem lies in the environment settings but I can't for the life of me figure out what to change.
Input: Shapefiles with polygons and GRID raster files that hold the correct output info.
Tool: Zonal Stats as Table
Output: Table showing the MEAN results for all polygons in the shapefile.
Problem: The results do not match the raster info.....close, but not quite.
Solution: STILL RACKING MY BRAIN :mad:
Resort: HELP!!!
0 Kudos
TOMKONG
Occasional Contributor II
No...the MEAN is supposed to take the average of all the raster pixels within the corresponding polygon. Here's a snapshot of what I'm working on (Note: has been revised):
[ATTACH=CONFIG]26185[/ATTACH]

At this point I'm pretty sure my problem lies in the environment settings but I can't for the life of me figure out what to change.
Resort: HELP!!!


Did you try using 1*1 cell size?

In another way you can check the result and error reason:
1. Convert your raster to the points (shapfile or geodabase feature class) with code attribute value;
2. Intesect point layer and zonal polygon layer: the intesected point layer will hold both zonal code and raster code values;
3. Using summarized founction (click the ID field name from polygon layer, select "summzrized") to get MEAN value (you can select MEAN, MIN, MAX, MAJ...) for each polygon ID.
----you can do zonal data statistics based on all shapfile also, not always deal with raster.
0 Kudos
ShikoNjuno
Occasional Contributor
Interesting things is why you are using MEAN value for landuse code(?)? Want to see the changes after year by year?


This got me thinking....there's no reason to look at the MEAN of the raster files, really what I want is the MAX because in the event that land were to be fallowed in the future, for instance, that statistic tells me the maximum value "lost". And then if I wanted to perform a MEAN statistic, it would be for several of the polygons from the shapefile; this could be done via a Field Statistics analysis!!!!
Problem solved 😄
Thanks for leading me down that thought process!
Cheers.
0 Kudos
ShikoNjuno
Occasional Contributor
Well I'm getting closer to the right output, but in going back and checking ALL the values, I still have one last issue.
Some of the values that I'm getting after running the Zonal Stats tool are slightly off. I'm not getting the raster value that I expect for that shapefile polygon, instead, I'm getting the raster value of the neighboring polygon!!! This isn't happening for all polygons though, just some of them....so it's not very consistent which makes it harder to narrow in on the issue. I'm not too familiar with either one of these but I'm guessing it has something to do with pyramids or resampling methods.
Can anyone help me figure out what might be going on?
Below are my current Zonal Statistics as Table Environment Settings:
[ATTACH=CONFIG]26225[/ATTACH]
Any thoughts?!!
0 Kudos