没有合适的资源?快使用搜索试试~ 我知道了~
首页ARCGIS中Python实现批量裁剪.docx
资源详情
资源评论
资源推荐

程序代码:
[python]view plaincopyprint?
1. importarcpy
2. arcpy.CheckOutExtension("spatial")
3. arcpy.gp.overwriteOutput=1
4. arcpy.env.workspace="F:\Modis_16\1Moasic"
5. rasters=arcpy.ListRasters("*","tif")
6. mask="F:\VegetationChange\Data\Bound\bound_Buffer_Polygon.shp"
7. forrasterinrasters:
8. print(raster)
9. out="F:\VegetationChange\Data\GIMMSData\
new\"+"ma_"+raster[0:8]
10. arcpy.gp.ExtractByMask_sa(raster,mask,out)
11. print("ma_"+raster[0:8]+"hasdone")
12. print("Alldone")
二、注意事项:
1.arcpy.gp.overwriteOutput=1 即覆盖之前的文件;
2.输入的是.tif 文件,输出的是 Grid 文件;
3.raster[0:8]表示从第 0 个开始取 8 个字符串;
4.bound_Bu&er_Plygon.shp 后缀名不可或缺。
三、运行情况:















安全验证
文档复制为VIP权益,开通VIP直接复制

评论0