#删除格网要素 必须两次才删除干净
arcpy.management.Delete("格网d",'')
arcpy.management.Delete("格网d",'')
for i in range(1,159):
#按属性选中要素
arcpy.management.SelectLayerByAttribute("格网", "NEW_SELECTION", "ID = "+str(i), None)
#导出要素
arcpy.conversion.ExportFeatures("格网", r"D:\工作\兼职\24-4-21 图像处理\MyProject\MyProject.gdb\格网d")
out_raster = arcpy.sa.ExtractByMask("Landsat8OLI000000000_1.tif", "格网d", "INSIDE")
out_raster.save(r"D:\工作\兼职\24-4-21 图像处理\MyProject\安徽\Extract_"+str(i)+'.tif')
# 删除指定的要素
arcpy.management.Delete("格网d",'')
arcpy.management.Delete("格网d",'')
arcpy选中要素 删除要素
最新推荐文章于 2024-08-13 18:29:56 发布