IZonalOp::ZonalStatistics fails when both a string field and a selection are used in RasterDescriptor

Last Published: April 25, 2020


When calling the IZonalOp::ZonalStatistics method, if the zone is defined by a RasterDescriptor in which both a selection and a string field are used, the operation fails.


This is a known issue with ArcGIS 8.1.

Solution or Workaround

There are two solutions for this problem:

  • Convert the zone raster into a feature class using the Conversion function in the Spatial Analyst user interface. Then, create a FeatureDescriptor from the feature class just created, and pass the FeatureDescriptor to the operator.
  • Do the conversion and creation as two steps in VB code. First do a conversion with the selection using IConversionOp::ToRasterDataset. Next, create a RasterDescriptor using the output from the conversion with the string field only.

Article ID:000003471

  • ArcMap 8 x

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic