2 garfield198810 garfield198810 于 2014.12.19 21:19 提问

arcgis中将批量将grd文件转为tiff格式的文件出现问题。

在python下执行。程序:

Import system modules

import sys, string, os

dir = 'F:\test'

Import arcpy module

import arcpy

files = os.listdir(dir)
for f in files:
if os.path.splitext(f)[1] == '.grd':
# Script arguments...
Input_raster_file = dir + os.sep + f

    # Local variables...
    Output_data_type = "FLOAT"
    Raster_Format = "TIFF"
    Output_Workspace = "f:\\test\\TIFF"

    # =============== file name process ======================
    basename = os.path.splitext(f)[0];
    Output_raster = Output_Workspace + os.sep + basename + ".tif";

    if os.path.exists(Output_raster) == False:
        print Input_raster_file
        # Process: Raster To Other Format (multiple)...
        arcpy.RasterToOtherFormat_conversion(Input_raster_file, 
                    Output_Workspace, Raster_Format)

        print Output_raster

f盘下的test里的grd文件批量转为tif。错误提示:

Failed to convert: . ERROR 999999: Error executing function.
Failed to execute (CopyRaster).

Completed script RasterToOtherFormat...
Succeeded at Fri Dec 19 20:42:53 2014 (Elapsed Time: 1.00 seconds)

请问这是怎回事?

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!