Skip To Content

Nibble function

Available with Spatial Analyst license.

Overview

The Nibble global function allows selected areas of a raster to be assigned the value of their nearest neighbor. This is useful for editing areas of a raster where the data may be erroneous.

First, the algorithm determines all areas from the mask raster with the value NoData. The corresponding areas on the input raster will be nibbled. Second, an internal Euclidean allocation is performed to allocate values to the masked pixels based on Euclidean distance.

The value of the pixels from the input raster that correspond to the pixels of NoData from the mask raster are nibbled and replaced by the value of the nearest neighbor according to Euclidean distance.

In the following example, the Nibble function was applied to the input and mask rasters. Nibble will only be applied to the NoData values in the mask raster. All non-NoData pixels on the mask raster receive the value from the input raster. These cell values and their locations will be used to assign values to the NoData locations identified on the mask raster. The NoData locations will receive the value of the cell in the input raster that is identified as the closest non-NoData cell on the mask raster.

Nibble illustration

Notes

Pixels in the input raster containing NoData are not nibbled. To nibble NoData, first convert it to another value.

Parameters

ParametersDescription

Raster

The input raster that will be nibbled.

The input raster can be either integer or floating-point type.

Mask Raster

The raster used as the mask.

Pixels with NoData as their value will be nibbled in the input Raster.

The mask raster can be either integer or floating-point type.

Use NoData values if they are the nearest neighbor

Defines if NoData values in the input raster are allowed to nibble into the area defined by the mask raster.

  • Yes—Specifies that the nearest neighbor value will be used whether it is NoData or another data value in the input raster. NoData values in the input raster are free to nibble into areas defined in the mask if they are the nearest neighbor. This is the default.
  • No—Specifies that only data values are free to nibble into areas defined in the mask raster. NoData values in the input raster are not allowed to nibble into areas defined in the mask raster even if they are the nearest neighbor.

Nibble NoData cells

Defines if NoData pixels in the input raster will remain NoData in the output raster.

  • No—Specifies that NoData pixels in the input raster will remain NoData in the output. This is the default.
  • Yes—Specifies that NoData pixels in the input raster and within the mask can be nibbled into valid output cell values.

Zone Raster

The input zone raster.

A zone is all the pixels in a raster that have the same value, whether or not they are contiguous. The input zone layer defines the shape, values, and locations of the zones. The zone raster can be either integer or floating point type.

Licensing

This function requires that the ArcGIS Spatial Analyst extension to be enabled.