kywyg 2020-11-17 18:16 采纳率: 100%
浏览 237
已采纳

CopyRaster,提示不对,请指点下问题出在那里

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).
 

  • 写回答

1条回答 默认 最新

  • PythonJavaC++go 2020-11-17 19:21
    关注

    文件路径不对

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥66 定制开发肯德基自动化网站下单软件
  • ¥20 vscode虚拟环境依赖包未安装
  • ¥15 odoo17关于owl开发js代码问题
  • ¥15 光纤中多普勒频移公式的推导
  • ¥15 怎么制作一个人脸识别门禁系统
  • ¥20 大华dss监控平台网络关闭登不进去
  • ¥15 请使用蚁群算法解决下列问题,并给出我完整的代码
  • ¥20 关于php录入完成后,批量更新数据库
  • ¥15 请教往复密封润滑问题
  • ¥15 cocos creator发布ios包