Extract one band from 3 band raster

10519
5
06-27-2011 09:59 AM
StephanieSnider
Occasional Contributor III
ArcGIS 10 SP2, Windows XP

I know there must be a simple solution to this, but I haven't found it yet.  Is there a way to extract one band from a 3-band raster and output that to a new one-band raster dataset?  I see there is a tool for composite bands, for making several rasters into one raster.  But how to you go the other direction?
0 Kudos
5 Replies
RobertBerger
New Contributor III
Greetings,

Yes, the composite bands tool will accomplish this. You can drill into the raster and input the desired band to the tool.

Robert
0 Kudos
StephanieSnider
Occasional Contributor III
Oh, I see.  You have to select the band within the raster and not the raster itself.  Got it.  I can use the copy Raster tool.  Thanks!
0 Kudos
StephanieSnider
Occasional Contributor III
In case anyone needs to do this in batch mode like myself, here's some python to help:

# Import arcpy module
import arcpy

origin = "E:\\SDEstage\\Unloaded\\3-band\\"
arcpy.env.workspace = origin
RasterList = arcpy.ListRasters()
RasterList2 = []

# Remove the ".tif" in order to create raster name that will store in FGD
for x in range(len(RasterList)):
    [INDENT]RasterList2 = RasterList2 + [RasterList[:-4]][/INDENT]

for i in range(len(RasterList2)):
    [INDENT]# Set Tif and Band #
    TiftoLoad = origin + RasterList2 + ".tif\\Band_1"
    # Since these tif file names begin with a number, add letter to beginning in order to store in FGD.
    dest = "E:\\SDEstage\\Rasters.gdb\\A" + RasterList2
    # Copy raster
    arcpy.CopyRaster_management(TiftoLoad, dest, "", "", "", "NONE", "NONE", "")
    print "Converted " + RasterList2[/INDENT]
0 Kudos
ScottRoberts
New Contributor
How do you select the band within the raster and not the raster itself?
0 Kudos
FionaGregory
New Contributor II
Here's one way:
In ArcCatalog - Contents tab - click on the name of the raster and it will drill down to the individual bands. Drag each band from ArcCatalog into the Composite Bands tool.