python定义影像投影

import os
import arcgisscripting
gp=arcgisscripting.create()
coordsys=r"C:Winx86ArcGISCoordinate SystemsGeographic Coordinate SystemsAsiaXian 1980.prj"

root=r"c:需要设置投影的目录"
for p,dirname,filename in os.walk(root):
    for name in filename:
	    ext=os.path.splitext(name)[1]
		if ext==".tif":
		    test=os.path.join(p,name)
			print test
			gp.defineprojection(test,coordsys)
			
print "DONE!"

  

原文地址:https://www.cnblogs.com/janehlp/p/5505109.html