Nibble |
|
Release 9.2
Last modified January 3, 2008 |
Print all topics in : "Generalization (Spatial Analyst)" |
Replaces cells of a raster corresponding to a mask with the values of the nearest neighbors.
Learn more about how Nibble works
Illustration
Usage tips
Command line and Scripting
The input raster and input raster mask must be integers.
Cells in the input raster containing NoData are not nibbled. To nibble NoData, convert it to another value.
The following environment settings affect this tool:
Map Algebra
The <in_grid> and <mask_grid> must be integer rasters.
Cells in the <in_grid> containing NoData are not nibbled. To nibble NoData, convert it to another value.
Learn more about how to specify the input raster dataset in the Map Algebra expression of Raster Calculator.
ArcObjects
The input raster and maskRaster must be integer.
Cells in the input raster that are NoData are not nibbled. To nibble NoData, convert it to another value.
The output from the ArcObjects method is a raster object.
Command line syntax
An overview of the Command Line window
Nibble_sa <in_raster> <in_mask_raster> <out_raster> {ALL_VALUES | DATA_ONLY}
Parameter | Explanation | Data Type |
<in_raster> |
Input raster. |
Composite Geodataset |
<in_mask_raster> |
The raster used as the mask. Cells with NoData as their value will be nibbled in the in_raster. |
Composite Geodataset |
<out_raster> |
The raster to be created. |
Raster Dataset |
{ALL_VALUES | DATA_ONLY} |
Keywords defining if NoData values in the in_raster are allowed to nibble into the area defined by the in_mask_raster.
|
Boolean |
Nibble_sa C:/data/ras_1 C:/data/mask_1 C:/data/final_1 ALL_VALUES
Scripting syntax
About getting started with writing geoprocessing scripts
Nibble_sa (in_raster, in_mask_raster, out_raster, nibble_values)
Parameter | Explanation | Data Type |
in_raster (Required) |
Input raster. |
Composite Geodataset |
in_mask_raster (Required) |
The raster used as the mask. Cells with NoData as their value will be nibbled in the in_raster. |
Composite Geodataset |
out_raster (Required) |
The raster to be created. |
Raster Dataset |
nibble_values (Optional) |
Keywords defining if NoData values in the in_raster are allowed to nibble into the area defined by the in_mask_raster.
|
Boolean |
# Nibble_sample.py # Description: # Replaces cells of a raster corresponding to a mask, with the # values of the nearest neighbors. # Requirements: None # Author: ESRI # Date: Sept 6, 2005 # Import system modules import arcgisscripting # Create the Geoprocessor object gp = arcgisscripting.create() try: # Set local variables outRaster = "C:/data/final_1" inRaster = "C:/data/ras_1" maskRaster = "C:/data/mask_1" # Check out Spatial Analyst extension license gp.CheckOutExtension("Spatial") # Process: Majority Filter... gp.Nibble_sa(filter, maskRaster, outRaster, "ALL_VALUES") except: # If an error occurred while running a tool, then print the messages. print gp.GetMessages()
Map Algebra syntax
Nibble(<in_grid>, <mask_grid>, {ALL | DATAONLY})
Parameter | Explanation |
<in_grid> | The name of a raster. |
<mask_grid> | The name of a raster used as the mask.
Cells with NoData as their value will be nibbled in the <in_grid>. |
{ALL | DATAONLY} | Keywords defining if NoData values in the <in_grid> are allowed to nibble into the area defined by the <mask_grid>.
|
nibble(inputgrid, maskgrid)
ArcObjects syntax
IGeneralizeOp::Nibble (raster As IGeoDataset, maskRaster As IGeoDataset, useNoData As Boolean) As IGeoDataset
Parameter | Explanation |
raster | The name of a raster. |
maskRaster | The name of a raster used as the mask.
Cells with NoData as their value will be nibbled in the first input raster. |
useNoData | Boolean defining if NoData values in the raster are allowed to nibble into the area defined by the maskRaster.
If True, the nearest neighbor value will be used whether it is NoData or another data value in the first input raster. NoData values in the first input raster are free to nibble into areas defined in the maskRaster if they are the nearest neighbor. If False, only data values are free to nibble into areas defined in the maskRaster. NoData values in the first input raster are not allowed to nibble into areas defined in the maskRaster even if they are the nearest neighbor. |
' Create the GeneralizeOp object Dim pGeneralizeOp As IGeneralizeOp Set pGeneralizeOp = New RasterGeneralizeOp ' Create the input raster object Dim pInputDataset As IGeoDataset ' Calls function to open the input raster dataset from disk Set pInputDataset = OpenRasterDataset ("D:\SpatialData", "inputraster") ' Create the input mask raster object Dim pMaskDataset As IGeoDataset ' Calls function to open the mask raster dataset from disk Set pMaskDataset = OpenRasterDataset ("D:\SpatialData", "maskraster") ' Create the output dataset object Dim pOutputDataset As IGeoDataset ' Calls the method Set pOutputDataset = pGeneralizeOp.Nibble (pInputDataset, pMaskDataset)