Zonal Statistics can't find field name

3591
5
05-09-2012 05:25 PM
DanielVictoria
New Contributor
I have a model in model builder that at some point does a Zonal Statistics between two rasters. Last time I used the model was working fine but today, when I tried to run the model, it complained that zone field is not correct. I have the zone field set to Value (the zone mape is a raster). Has anyone seen this error before? Could it be due to some bad instalation (I installed some other flavor of python after installing ArcMap.

Thanks
Daniel
0 Kudos
5 Replies
curtvprice
MVP Esteemed Contributor
Could it be due to some bad installation (I installed some other flavor of python after installing ArcMap.)


This is only supported if you update "dot versions".

For example, Python 2.6.2 to 2.6.8. ArcGIS 10 will not work correctly with Python 2.7.
0 Kudos
DanielVictoria
New Contributor
I've got python 2.7 installed and also python 2.6 (which came from Arc). Opening the python console in Arc and typing help() shows me that the python version used is 2.6. But is the process from modelbuilder running with python 2.6? Or 2.7? I'm running ArcGIS 10 with SP3 installed

Here is the actual output from the model builder at the point it gives me the error.
Executing (Zonal Statistics): ZonalStatistics E:\topo_sp\scratch\Basin_FlowDi1 Value E:\topo_sp\scratch\Extract_srtm1 E:\topo_sp\scratch\ZonalSt_Basi1 MAXIMUM DATA
Start Time: Thu May 10 08:14:59 2012
ERROR 010123: Could not get field name.
Failed to execute (Zonal Statistics).
Failed at Thu May 10 08:14:59 2012 (Elapsed Time: 0.00 seconds)

Some more info: Tried to run ZonalStats in Arc python console and the same error apears:
arcpy.sa.ZonalStatistics('Basin_inv', "Value", "cume", "MAXIMUM", "NODATA")
Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 010123: Could not get field name. Failed to execute (ZonalStatistics).


Thanks for the help
Daniel
0 Kudos
JeffreySwain
Esri Regular Contributor
Does your zone raster have an attribute table?  I would check there first, occassionally even if the raster is an integer/discrete dataset, there is no raster attribute table created and must be created afterwards.  Use the Build Raster Attribute Table if you do not see a raster attribute table to open.
0 Kudos
DanielVictoria
New Contributor
More information. The procedure worked in a smaller region, with 11630 areas, but it's chocking when I give the full dataset that has 256688 distinct zones! Is there a limit on the number of zones ZonalStatistics can manage? How can I overcome this? And why is the error message not related to the problem?

Thanks
0 Kudos
DanielVictoria
New Contributor
Does your zone raster have an attribute table?  I would check there first, occassionally even if the raster is an integer/discrete dataset, there is no raster attribute table created and must be created afterwards.  Use the Build Raster Attribute Table if you do not see a raster attribute table to open.


BINGO!! The smaller raster had an attribute table build by default but the one with 266k zones did not. Building the attribute table made the process go through. Will put that step into the model routine so I don't hit that problem anymore.

As a tip, couldn't the error message state that the attribute table was not found instead of saying that the chosen field was not found. Because in my (dumb) mind, the error "Could not get field name" tells me there is a table but the chosen field is not there...

Thanks for all the help
Daniel
0 Kudos