Batch convert Raster to Other Format

826
2
02-24-2012 12:05 PM
OsmanSABAN
New Contributor
Hi all,

I am using below python code to convert rasters from one format to tiff, but this code converts one by one. Can anyone help me how to use it as batch tool?

I need help really urgently.

Thanks..


import arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

try:
    # Set local variables
    InRaster = "C:\\\\L71010028_02820020717\L71010028_02820020717_HDF.L1G"
    OutWorkspace = "C:\\\\Image Test"

    # Process: RasterToOtherFormat_conversion (convert to TIFF format)
    gp.RasterToOtherFormat_conversion(InRaster,OutWorkspace,"TIFF")

except:
    # Print error message if an error occurs
    print gp.GetMessages()
Tags (2)
0 Kudos
2 Replies
curtvprice
MVP Esteemed Contributor
I need help really urgently.

There is a tool in 9.3 that does this:
Raster To Other Format (Multiple) in the Conversion toolbox.
0 Kudos
HILLARYHALL
New Contributor II
Sorry, I am not so familar with python code, I program with visual basic and c# languages. Recently, I just have finished my document reading and processing sdk, which contains the tiff converter that allows to convert multi-page tiff document into rasther images, such as tiff to bmp, tiff to png, tiff to gif and jpeg. Also, this tiff converting tool supports converting in batch mode, users who are going to use it needn't to convert one by one. If you are interested, you can try the barch tiff converter and give me some feedback to perfect it. Thanks!
0 Kudos