该Resample_management
功能是 ArcPy 模块的一部分,该模块只能与 ArcGIS 软件一起安装。它的默认形式是:
arcpy.Resample_management("D:\InputFile", "D:\OutputFile.tif", "1000 1000", "BILINEAR")
这样就可以了。但是当我把它放在一个循环中时,我得到了一个错误。
Input=glob.glob("D:\Freelancer\oDesk\Create-ArcPy-Scripts\TestFiles\*tif")
#Glob makes an array with all the TIF files inside a folder.
for i in Input:
arcpy.Resample_management(i, "D:\OutputFolder\%s_1000.tif" % i, "1000 1000", "BILINEAR")
Runtime error Traceback (most recent call last): File "<string>", line 2, in <module> File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 12407, in Resample raise e ExecuteError: ERROR 999999: Error executing function. Failed to execute (Resample).
如果我查找 ERROR 999999,它会说“这是一个没有 ID 的错误”。我的循环有问题还是显然是 ArcPy 模块的问题?