当前位置:   article > 正文

ARCGIS中Python实现按属性字段批量掩膜提取

arcgis中按掩膜提取python工具箱代码

ARCGIS中Python实现按属性字段批量掩膜提取

import arcpy

import string

from arcpy.sa import *

 

try:

  raster = arcpy.GetParameterAsText(0)

  clip_feat = arcpy.GetParameterAsText(1)

  field = arcpy.GetParameterAsText(2)

  outworkspace = arcpy.GetParameterAsText(3)

   

   for row in arcpy.SearchCursor(clip_feat):

     mask=row.getValue("Shape")

     outPath=outworkspace+"\\"+str(row.getValue(field))

     outExtractByMask = ExtractByMask(raster,mask)

     outExtractByMask.save(outPath)

 

except arcpy.ExecuteError:

    print arcpy.GetMessages()

转载于:https://my.oschina.net/u/3086669/blog/796942

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

闽ICP备14008679号