资源简介
利用python创建批量裁剪栅格工具,实现栅格数据批量裁剪

代码片段和文件信息
# Purpose : ClipRasterByFeature
import sys
reload(sys)
sys.setdefaultencoding( “utf-8“ )
import arcpy
import string
try:
in_raster = arcpy.GetParameterAsText(0)
clip_feature = arcpy.GetParameterAsText(1)
field = arcpy.GetParameterAsText(2)
outpath = arcpy.GetParameterAsText(3)
outputtype = arcpy.GetParameterAsText(4)
result = arcpy.GetCount_management(clip_feature)
total = int(result.getOutput(0))
count= 1
for row in arcpy.SearchCursor(clip_feature):
mask=row.getValue(“shape“)
extent=str(mask.extent.XMin)+“ “ +str(mask.extent.YMin)+“ “ +str(mask.extent.XMax)+“ “ +str(mask.extent.YMax)
out_raster=outpath+“\\“+str(str(row.getValue(field))+outputtype)
arcpy.AddMessage(“chipping: “ + str(row.getValue(field)) + “...count:“+str(total)+“\\“+str(count))
arcpy.Clip_management(in_rasterextentout_rastermask“0““ClippingGeometry“)
count=count+1
except arcpy.ExecuteError:
print arcpy.GetMessages()
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1092 2017-11-24 11:58 批量裁剪栅格\批量裁剪栅格.py
文件 8704 2017-11-24 13:40 批量裁剪栅格\批量裁剪栅格.tbx
目录 0 2017-11-24 13:39 批量裁剪栅格\
相关资源
- 二级考试python试题12套(包括选择题和
- pywin32_python3.6_64位
- python+ selenium教程
- PycURL(Windows7/Win32)Python2.7安装包 P
- 英文原版-Scientific Computing with Python
- 7.图像风格迁移 基于深度学习 pyt
- 基于Python的学生管理系统
- A Byte of Python(简明Python教程)(第
- Python实例174946
- Python 人脸识别
- Python 人事管理系统
- 基于python-flask的个人博客系统
- 计算机视觉应用开发流程
- python 调用sftp断点续传文件
- python socket游戏
- 基于Python爬虫爬取天气预报信息
- python函数编程和讲解
- Python开发的个人博客
- 基于python的三层神经网络模型搭建
- python实现自动操作windows应用
- python人脸识别(opencv)
- python 绘图(方形、线条、圆形)
- python疫情卡UN管控
- python 连连看小游戏源码
- 基于PyQt5的视频播放器设计
- 一个简单的python爬虫
- csv文件行列转换python实现代码
- Python操作Mysql教程手册
- Python Machine Learning Case Studies
- python获取硬件信息
评论
共有 条评论