当前位置:   article > 正文

arcgis pro利用python进行批量掩膜提取_arcpy 实现多个矢量数据批量按掩膜提取

arcpy 实现多个矢量数据批量按掩膜提取

import arcpy
from arcpy import env
from arcpy.sa import *
import os

env.workspace = r"F:\ArcGIS\Projects\zhibodaoganhanfengxian\zhibodaoganhanfengxian.gdb"

filepath = r"C:\Users\WH\Desktop\zhibodao\EPRE"
filenames=[file for file in os.walk(filepath)]
inRasters=[]
for file in filenames[0][-1]:
    if file.endswith(".tif"):
       inRasters.append(file)

inMaskData = r"E:\ArcGIS\Projects\cailiao\AICGIS\zhongyao\mian.shp"
i=1965
for inRaster in inRasters:
    outExtractByMask = ExtractByMask(filenames[0][0]+"\\"+inRaster,inMaskData)
    outExtractByMask.save(r"C:\Users\WH\Desktop\SDR_drougth\EPRE\EPRE"+str(i)+".tif")
    i = i + 1

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/81124
推荐阅读
相关标签
  

闽ICP备14008679号