用Arcpy将10年的.txt格式文件批量生成.tif格式文件


import arcpy
from arcpy import env
from arcpy.sa import *  # 运行ascii to raster 工具必不可少

arcpy.CheckOutExtension("spatial")
env.overwriteOutput=1

workingDir=r"D:\\lyj\\code\\"
env.workspace=workingDir+"globe_temp"

in_ascii_files=arcpy.ListFiles()
outRasterSpace=r"D:\\lyj\\code\\globe_temp_raster\\"

for in_ascii_file in in_ascii_files:
    print in_ascii_file
    arcpy.ASCIIToRaster_conversion(in_ascii_file,outRasterSpace+in_ascii_file+".tif","FLOAT")

转载自:https://blog.csdn.net/darcy_vb/article/details/85918265

You may also like...

退出移动版