import arcpy.da as da
import os
import arcpy
arcpy.env.workspace = r"G:\下载文件\Globalland 30\2000LC030"
outspace = "G:\下载文件\Globalland 30\2000LC030"
for dirpath,dirnames, filenames in da.Walk(os.getcwd(),datatype = "RasterDataset", type = "TIF"):
for filename in filenames:
arcpy.CopyRaster_management( "filename", "os.path.join(outspace,filename)", "DEFAULTS", "0", "0", format="TIFF")
一直提示如下错误:
Traceback (most recent call last):
File "G:/下载文件/Globalland 30/Copy Raster(del 0).py", line 8, in <module>
arcpy.CopyRaster_management( "filename", "os.path.join(outspace,filename)", "DEFAULTS", "0", "0", format="TIFF")
File "D:\ArcGIS\Desktop10.8\ArcPy\arcpy\management.py", line 14857, in CopyRaster
raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Raster: Dataset filename does not exist or is not supported
Failed to execute (CopyRaster).