Composite Bands (Data Management)

License Level:BasicStandardAdvanced

Summary

Creates a single raster dataset from multiple bands and can also create a raster dataset using only a subset of bands.

Illustration

Composite Bands illustration

Usage

Syntax

CompositeBands_management (in_rasters, out_raster)
ParameterExplanationData Type
in_rasters
[in_rasters,...]

The input raster datasets.

Mosaic Dataset ; Mosaic Layer ; Raster Dataset ; Raster Layer
out_raster

The output raster dataset.

When storing the raster dataset in a file format, you need to specify the file extension:

  • .bil—Esri BIL
  • .bip—Esri BIP
  • .bmp—BMP
  • .bsq—Esri BSQ
  • .dat—ENVI DAT
  • .gif—GIF
  • .img—ERDAS IMAGINE
  • .jpg—JPEG
  • .jp2—JPEG 2000
  • .png—PNG
  • .tif—TIFF
  • no extension for Esri Grid

When storing a raster dataset in a geodatabase, no file extension should be added to the name of the raster dataset.

When storing your raster dataset to a JPEG file, a JPEG 2000 file, a TIFF file, or a geodatabase, you can specify a compression type and compression quality.

Raster Dataset

Code Sample

This is a Python sample for the Composite Bands tool.

import arcpy
from arcpy import env
env.workspace = "c:/data"
arcpy.CompositeBands_management("band1.tif;band2.tif;band3.tif",
                                "compbands.tif")

This is a Python script sample for the Composite Bands tool.

##====================================
##Composite Bands
##Usage: CompositeBands_management in_rasters;in_rasters... out_raster

try:
    import arcpy
    arcpy.env.workspace = r"C:/Workspace"
    
    ##Compose multi types of single band raster datasets to a TIFF format raster dataset
    arcpy.CompositeBands_management("band1.tif;comp.mdb/band2;comp.gdb/bands/Band_3","compbands.tif")
    
except:
    print "Composite Bands example failed."
    print arcpy.GetMessages()

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
11/18/2013