import arcpy
... arcpy.env.workspace = ('D:\\P-gis\\Wetland\\LAI\\3.M_LAI\\')#栅格文件位置
... OutputFile = open('D:\\P-gis\\Wetland\\LAI\\statisticResult_LAI.txt', 'w') #属性数据输出文件
... rlist = arcpy.ListRasters('*','tif')
... for file in rlist:
... meanValueInfo = arcpy.GetRasterProperties_management(file,'MEAN')
... meanValue = meanValueInfo.getOutput(0)
... print file + ',' + str(meanValue) +'\n'
... OutputFile.write(file + ',' + str(meanValue) +'\n')
... OutputFile.close()
... print("All done")
栅格统计数据批量输出
最新推荐文章于 2024-05-14 21:41:28 发布