Define Mosaic Dataset NoData (Data Management)

Summary

Allows you to specify one or more NoData values for a mosaic dataset.

Usage

Syntax

DefineMosaicDatasetNoData_management (in_mosaic_dataset, num_bands, {bands_for_nodata_value}, {bands_for_valid_data_range}, {where_clause})
ParameterExplanationData Type
in_mosaic_dataset

Path and name of the mosaic dataset.

Mosaic Layer
num_bands

Defines the number of bands in the mosaic dataset.

This value will be populated automatically, based on the mosaic dataset that is added, but you can override it.

Long
bands_for_nodata_value
[band {value},...]
(Optional)

Define a single value for each or all bands. Each band can have a unique NoData value defined, or the same value can be specified for all bands.

The Mask function inserted by this tool, is inserted before the Composite Bands function in the function chain. Therefore if the function chain for each raster within the mosaic dataset contains the Composite Bands function, or if your raster data was added with a raster type that adds the Composite Bands function to each raster’s function chain, then any value you specify will apply to all bands.

Value Table
bands_for_valid_data_range
[band {minimum value} {maximum value},...]
(Optional)

The band number and the minimum and maximum pixel value of valid data. The NoData values will be those values outside the range. For example, for an 8-bit image, if you specify band1=10–200, then values 0–9 and 201–255 will be defined as NoData.

The Mask function inserted by this tool, is inserted before the Composite Bands function in the function chain. Therefore if the function chain for each raster within the mosaic dataset contains the Composite Bands function, or if your raster data was added with a raster type that adds the Composite Bands function to each raster’s function chain, then any value you specify will apply to all bands.

Value Table
where_clause
(Optional)

Using SQL you can define a query or use the Query Builder to build a query.

SQL Expression

Code Sample

DefineMosaicDatasetNoData example 1 (Python window)

This is a Python sample for DefineMosaicDatasetNoData.

import arcpy
arcpy.DefineMosaicDatasetNoData_management("c:/workspace/fgdb.gdb/NoData", \ 
                                           "OBJECTID=2", "3", \
                                           "ALL_BANDS 0 9", #")
DefineMosaicDatasetNoData example 2 (stand-alone script)

This is a Python script sample for DefineMosaicDatasetNoData.

##===========================
##Define Mosaic Dataset Nodata
##Usage: DefineMosaicDatasetNodata_management in_mosaic_dataset num_bands
##                               {Band {Value};Band {Value}...} {Band {Minimum
##                               Value} {Maximum Value};Band {Minimum Value}
##                               {Maximum Value}...} {where_clause}

try:
    import arcpy
    arcpy.env.workspace = "C:/Workspace"
    # Specify multiple Nodata values for all bands in one Catalog item
    arcpy.DefineMosaicDatasetNoData_management("Nodata.gdb/md", "3", "ALL_BANDS 0 9",\
                                               "#", "OBJECTID=2")
                                  
    # Specify Nodata values for each individual band                            
    arcpy.DefineMosaicDatasetNodata_management("Nodata.gdb/md", "3",\
                                               "BAND_1 0;BAND_2 10;BAND_3 255", "#",\
                                               "#")
    
    # Specify valid value range for each band
    arcpy.DefineMosaicDatasetNodata_management("Nodata.gdb/md", "3", "", \
                                               "BAND_1 0 255;BAND_2 10 100;BAND_3 1 200",\
                                               "#")
    
    
except:
    print "Define Mosaic Dataset Nodata example failed."
    print arcpy.GetMessages() 

Environments

Related Topics

Licensing Information

ArcView: No
ArcEditor: Yes
ArcInfo: Yes

10/27/2014