ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Nibble

Available with Spatial Analyst license.

  • Summary
  • Illustration
  • Usage
  • Syntax
  • Code Sample
  • Environments
  • Licensing Information

Summary

Replaces cells of a raster corresponding to a mask with the values of the nearest neighbors.

Learn more about how Nibble works

Illustration

Nibble illustration
OutRas = Nibble(InRas1, Mask_Ras)

Usage

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

  • See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.

Syntax

Nibble (in_raster, in_mask_raster, {nibble_values})
ParameterExplanationData Type
in_raster

The input raster that will be nibbled.

It must be of integer type.

Raster Layer
in_mask_raster

The raster used as the mask.

It must be of integer type.

Cells with NoData as their value will be nibbled in the in_raster.

Raster Layer
nibble_values
(Optional)

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

  • ALL_VALUES — 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.
  • DATA_ONLY —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.
Boolean

Return Value

NameExplanationData Type
out_raster

The output nibbled raster.

The identified input cells will be replaced with the values of their nearest neighbors.

The output is always of integer type.

Raster

Code Sample

Nibble example 1 (Python window)

This example replaces cells identified by the mask input with values determined by the nearest neighbors of the input raster.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
nibbleOut = Nibble("land", "snow", "DATA_ONLY")
nibbleOut.save("C:/sapyexamples/output/nibbleout")
Nibble example 2 (stand-alone script)

This example replaces cells identified by the mask input with values determined by the nearest neighbors of the input raster.

# Name: Nibble_Ex_02.py
# Description: Replaces cells of a raster corresponding to a mask 
#              with the values of the nearest neighbors.
# Requirements: Spatial Analyst Extension

# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *

# Set environment settings
env.workspace = "C:/sapyexamples/data"

# Set local variables
inRaster = "land"
inMask = "snow"

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute Nibble
nibbleOut = Nibble(inRaster, inMask, "ALL_VALUES")

# Save the output 
nibbleOut.save("C:/sapyexamples/output/outnibble")

Environments

  • Auto Commit
  • Cell Size
  • Compression
  • Current Workspace
  • Extent
  • Geographic Transformations
  • Mask
  • Output CONFIG Keyword
  • Output Coordinate System
  • Raster Statistics
  • Scratch Workspace
  • Snap Raster
  • Tile Size

Licensing Information

  • ArcGIS for Desktop Basic: Requires Spatial Analyst
  • ArcGIS for Desktop Standard: Requires Spatial Analyst
  • ArcGIS for Desktop Advanced: Requires Spatial Analyst

Related Topics

  • An overview of the Generalization toolset
  • Expand
  • Shrink
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal