This is my first post, I hope I don't screw it up. We have about 400 MODIS HDF4 files we are looking to batch process in the ArcGIS 10 or Python environment. The tools we are looking to use are Extract Subdataset (HDF4 files have subdatasets and we are only interested in one of them, which its index number is 1), ProjectRaster(to UTM 11 NAD 83), convert HDF4 files to TIFF (although I believe this can be done when executing the Extract Subdataset tool as it lets you choose an output file format), Int (we need the raster file to have an attribute table with pixel values). I've tried performing these tasks in modelbuilder in batch mode but i've had no success in properly setting it up.

We are interested in both the ModelBuilder and Python approach.

It would be great if someone can post some batch processing code that would apply to these tools.

2 Answers
2

Sounds do-able. I would suggest looking at the docs, specifically the sections on listing data and the tools you need to use, such as the Extract Subdataset tool - there are lots of samples in both of those sections to get you going. If I understand the issue properly, you need to get a list of the rasters, then iterate through that list, processing as you go: Extract Subdataset (save as tiff) -> Project -> Convert to int (you could use Map Algebra to do that).

EDIT: To change the filename, use some slicing to get only the name without the extension:

Yes, you understood me correctly, chad. I attempted to batch process using listing but I wasn't sure if that method was capable of performing the functions. It appears that it is. I'll take another look. Thanks for the recomendations.
–
dchaboyaDec 6 '11 at 16:35

I have another question. I've succeded in performing Extract Subdataset as a batch. Now I would like to know how to change the name of output files. When I do this arcpy.ExtractSubDataset_management(hdf,"U:\\temp\\hdf\\subdataset_files\\" + hdf + ".tif", "0")it adds the .tif (i'm exporting here) and I would like it to remove the .hdf part of the name of the original file.
–
dchaboyaDec 6 '11 at 20:25