Hi folks
This may be more of an arcpy question than an SA question, but I'll ask anyway.
I'm looking for an automated way using arcpy to extract bands from ECW images. The only way I've been able to do this so far is to do it manually by loading the individual band to an ArcMap session, and then right-click > Export Data. I haven't been able to work out how to do this with any ArcToolbox tools, or any arcpy functions.
Have you been able to do this with arcpy or ArcToolbox in the past? How did you do it?
Thanks
Anthony
Let's say your image contains 3 bands, you can use the following model:
I also wrote a python code for this:
import arcpy
import os
arcpy.env.workspace = r" "
rasterfile = Input Raster
desc = arcpy.Describe(rasterfile)
for band in range (1, desc.bandCount+1):
outputRaster = "rdlayer_" + str(band)
print(outputRaster)
arcpy.management.MakeRasterLayer(rasterfile, outputRaster, '', envelope="", band_index=str(band))
Hope that helps.