Zonal Statistics value store in Shapefile?

3682
5
11-21-2017 04:24 PM
MarziehForoutan
New Contributor II

Hi there, I need the zonal statistics mean value for each polygon to be stored in the attribute table of the polygon in the shapefile attribute table. The zonal statistics gives me a raster and a zonal statistics to table gives me a table. I don't want these. I want the values of for example mean (mean of pixels within each polygon) right in my shapefile. Any suggestion is appreciated. 

Thanks

0 Kudos
5 Replies
DanPatterson_Retired
MVP Emeritus

Then you simply Join the Zonal statistics as table back to the zone file and everything will be there.

MarziehForoutan
New Contributor II

Thanks

0 Kudos
DanPatterson_Retired
MVP Emeritus

Marzieh, if my suggestion worked, or any suggestion worked, could you mark the correct one so that people searching for answers will know what was the answer.

0 Kudos
curtvprice
MVP Esteemed Contributor

You also should look into the Join Field tool, this can be easily set up in a little Model Builder tool to run your zonal statistics and join the statistic you want to the shapefile table. This tool has kind of slow performance but it is very handy for this particular workflow.

DanPatterson_Retired
MVP Emeritus

Curtis... don't forget to try the simple python....

arcpy.da.TableToNumpyArray(stuff) ... followed by

arcpy.da.ExtendTable(stuff)

Joins are quick and permanent, particular if you have a clean OBJECTID field in the input table and the destination table.  My new fav.