Python script to rename image tiles (geotiffs, sids, ecws…) using the index shapefile

Elsewhere I posted a script that I wrote to allow me to do this same task, to rename imagery tiles based on attributes in the index shapefile. It wasn’t perfect, and it had a couple extra steps, but I wrote it pretty quickly and it worked well enough. If you want to, you can read more about it on that other post, or the example application linked from there.

Earlier today, however, I greatly simplified this script so that I can skip the step of exporting the attribute table to a text file and then go through all that parsing. Instead, this uses a search cursor. I wrote this one at home on a machine with ArcGIS 10. This current version basically runs from IDLE, but I’m going to adapt it for a script tool, which is why I have “arcpy.GetParameterAsText()” in there for the input parameters. To run it from IDLE, I just delete those and insert the shapefile, fields, and workspace into the code. After I get it running neatly from within Arc 10, I’ll probably make a 9.3 compatible version to run at work. Here it is:

Leave a Reply

Your email address will not be published.