English

How To: Set the Environment settings for Zonal Statistics when using a feature layer as the zone layer

Summary

When running Zonal Statistics in Spatial Analyst, the analysis properties must be set correctly, otherwise the output table may be incorrect or have incomplete results. The features used in the zone layer are being rasterized to a grid that doesn’t properly match the value grid.

Procedure

This article assumes that the Spatial Analyst extension is enabled, and if necessary Spatial Analyst toolbar has been added to ArcMap. It also assumes that if the Geoprocessing tools are used, that the output is not an SDE Raster.

  • The following only applies to the Zonal Statistics tool found on the Spatial Analyst toolbar:

    1. Select the Spatial Analyst menu from the Spatial Analyst toolbar.

    2. Select Options.

    3. Select the Extent tab.

    4. Set the Analysis extents to Same as Layer '[Value Grid]', where [Value Grid] is the name of the layer being used as the value grid in the Zonal Statistics operation.

    5. Go back to the extents dropdown list and select As Specified Below. This will activate the Snap extent to option.

    6. Select the value grid from the list of layers.

    Note:
    This step insures the grid that is created snaps to the extent of the value grid.


    7. Select the Cell Size tab.

    8. Typically, this should be set to Same as Layer '[Value Grid]', where [Value Grid] is the name of the layer being used as the value grid in the Zonal Statistics operation. However, the size and proximity of the features used in the zone layer may necessitate a smaller cell size.

    Warning:
    When the cell size is set to something different than that of the value layer, the cells may not match properly. Make sure that the analysis cell size selected is such that the ratio of the cell sizes is some integer to one. An example is an analysis cell size set to 20 and the value grid calls are 100. So the ratio is 5:1. Don’t set the analysis cell size to 40 with a value grid cell size of 100, ratio 2.5:1.


    9. Click OK.

    10. Run the Zonal Statistics operation from the Spatial Analyst toolbar.
  • The following only applies to the Zonal Statistics and Zonal Statistics as Table GP tools found in the Spatial Analyst toolbox in ArcToolbox. Because the GP Environment Settings can affect all GP tools, this procedure will only change the settings for the Zonal Statistics tool to minimize the impact on all tools:

    1. Navigate to and open either ArcToolbox > Spatial Analyst toolbox > Zonal toolset > Zonal Statistics or Zonal Statistics as Table tool.

    2. Click the Environments... button.

    3. Click General Settings to expand.

    4. Set Output Extent to As Specified Below, this will active the Snap Raster option.

    5. In the Snap Raster option, either browse to, or select from the drop-down list, the raster that will be used as the value raster.

    Note:
    This step insures the grid that is created snaps to the extent of the value grid.


    6. Click Raster Analysis Settings to expand.

    7. In the Cell Size option, typically it is appropriate to either browse to, or select from the drop-down list, the raster that will be used as the value raster. However, the size and proximity of the features used in the zone layer may necessitate a smaller cell size. In this case, select the As Specified Below option and enter a cell size.

    Warning:
    When the cell size is set to something different than that of the value layer, the cells may not match properly. Make sure that the analysis cell size selected is such that the ratio of the cell sizes is some integer to one. An example is an analysis cell size set to 20 and the value grid calls are 100. So the ratio is 5:1. Don’t set the analysis cell size to 40 with a value grid cell size of 100, ratio 2.5:1.


    8. Click OK to close the Environment Settings dialog.

    9. Use the selected tool as described in the help.