Select to view content in your preferred language

Copy Raster- Force RGB

274
0
02-15-2011 01:30 AM
SoniaSandiago
New Contributor
Hi all,

I am working on a python script that copies tiffs while forcing conversion to RBG (running ArcEditor 9.3.1 no SA extension) Being a newbee in Python, the script does not work and not too keen on using the Batch of Copy Raster under DManagement. Any ideas about what's wrong with the script will be appreciated!


import arcgisscripting, sys, os
gp = arcgisscripting.create(9.3)
gp.Overwriteoutput = 1
# Load required toolboxes...
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")

#workspace
gp.workspace = "C:\GISData\ESRI_Data\test"

#List all features in  gp.workspace
rasters = gp.ListRasters("*")

for raster in rasters:
    gp.CopyRaster(raster,"C:\ESRI_Data\test\output\output.gdb","#","0","#","NONE",ColormapToRGB,"#")
        print raster + " is converted."


Thanks in advance for any suggestions.
0 Kudos
0 Replies