Python版的ArcGIS栅格计算器模板

来源:互联网 发布:公安大数据应用 编辑:程序博客网 时间:2024/05/30 18:30

import arcpyfrom arcpy.sa import *arcpy.CheckOutExtension("spatial")arcpy.gp.overwriteOutput=1#customarcpy.env.workspace="G:\\Phenology of 30 Years\\GIMMS 3g\\15Length\\1Length\\"#customoutpath="G:\\Phenology of 30 Years\\GIMMS 3g\\15Length\\2mean_len\\"#customoutfilename="mean";n=30;Sum=0files=arcpy.ListRasters()for file in files:    Sum=Sum+Raster(file)(Sum/n).save(outpath+outfilename)print("Done,please close")
说明:

(1)带#号的为需要改动的地方

(2)本例实现求平均


0 0