Created
September 29, 2014 15:35
-
-
Save amarinelli/119b2b5aaa0f2b4e57ed to your computer and use it in GitHub Desktop.
Export all bands of raster imagery to a folder workspace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arcpy | |
import os | |
in_raster = r"C:\gisworkspace\CASES\_DEVELOPMENT\156950\47_072.tif'" | |
out_folder = r"C:\gisworkspace\CASES\_DEVELOPMENT\156950" | |
desc = arcpy.Describe(in_raster) | |
for band in desc.children: | |
indiv_band = os.path.join(in_raster, band.name) | |
out_file = os.path.join(out_folder, band.name + '.tif') | |
arcpy.CopyRaster_management(indiv_band, out_file) | |
print "done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment