Zonal statistics as table

1141
2
02-06-2017 02:05 PM
ArthurFriesen
New Contributor

How do you select the value that is used in the "Zonal Statistics as table" tool. My single band raster has a number of attributes that I would like to use

0 Kudos
2 Replies
DanPatterson_Retired
MVP Emeritus

Zonal Statistics as Table and How it works would be your first stop.

DarrenWiens2
MVP Honored Contributor

I believe you're going to have to use an incarnation of Lookup before running Zonal Statistics as Table. Lookup creates a new raster based on values other than the "VALUE".

Here's an example in Raster Calculator using Zonal Statistics.

Regular syntax that would use the "VALUE":

ZonalStatistics("zones","OBJECT_ID","my_int_raster","MEAN")‍‍

Lookup syntax that would use values in "Field2":

ZonalStatistics("zones","OBJECT_ID",Lookup("my_int_raster","Field2"),"MEAN")‍‍

Unfortunately, I don't believe you can run ZonalStatisticsAsTable from within the Raster Calculator because it outputs a table, but you could cycle through your fields using Python, if you do need all the statistics types.