import arcpy
from arcpy import env
from arcpy.sa import *
import os
import os.path
import sys
arcpy.env.workspace = "E:\\xuancheng\\remotesensing\\tif"
rootdir = 'E:\\xuancheng\\remotesensing\\tif'
for dirpath,filename,filenames in os.walk(rootdir):
for filename in filenames:
if os.path.splitext(filename)[1] == '.tif':
filepath = os.path.join(dirpath,filename)
inRaster = filepath
outname = filename.replace('.tif','')
print "ok"
print filepath
print outname
outASCII = "E:\\1206\\"+outname+".asc"
arcpy.RasterToASCII_conversion(filepath, outASCII)
print outname
Python 实现ARCGIS中raster to ascii
最新推荐文章于 2024-07-28 10:35:47 发布