当前位置:网站首页>栅格矢量数据的裁剪
栅格矢量数据的裁剪
2022-06-28 13:26:00 【kelly1250230225】
栅格裁剪(ExtractByMask):同一栅格文件,不同矢量文件
#栅格裁剪(ExtractByMask):同一栅格文件,不同矢量文件
#Author: Changqing Guo
# coding: utf-8
import arcpy
from arcpy import env
from arcpy.sa import *
arcpy.CheckOutExtension("Spatial")
arcpy.env.workspace = "D:/Test/shp"
arcpy.env.overwriterOutput = True
outfiles = "D:/Test/out"
infiles = "D:/Test/Tif/00_dem.tif"
clipfiles = arcpy.ListFiles("*.shp")
for filename in clipfiles:
print("Processing:" + filename)
clipputfiles = arcpy.env.workspace + "/" + filename
outputfiles = outfiles + "/" + filename[:-4]
outExtractByMask = ExtractByMask(infiles, clipputfiles)
outExtractByMask.save(outputfiles + ".tif")
print "***OVER***"
print arcpy.GetMessages()
栅格裁剪(ExtractByMask):同一矢量文件,不同栅格文件
#栅格裁剪(ExtractByMask):同一矢量文件,不同栅格文件
#Author: Changqing Guo
# coding: utf-8
import arcpy
from arcpy import env
from arcpy.sa import *
arcpy.CheckOutExtension("Spatial")
arcpy.env.workspace = "Z:/0/01/01"
arcpy.env.overwriterOutput = True
outfiles = "Z:/0/01/05caijian/02et"
clipfiles = "Z://New_Shapefile.shp"
infiles = arcpy.ListFiles("*.tif")
for filename in infiles:
print("Processing:" + filename)
inputfiles = arcpy.env.workspace + "/" + filename
outputfiles = outfiles + "/" + filename
outExtractByMask = ExtractByMask(inputfiles, clipfiles)
outExtractByMask.save(outputfiles + ".tif")
print "***OVER***"
print arcpy.GetMessages()
边栏推荐
- matlab plotyy 坐标轴设置,[转载]Matlab plotyy画双纵坐标图实例[通俗易懂]
- 泛海微FH511单片机IC方案小家电LED照明MCU丝印FH511
- 几百行代码实现一个 JSON 解析器
- Embedded development: seven techniques for estimating battery life
- 为什么新的5G标准将为技术栈带来更低的 TCO
- How about stock online account opening and account opening process? Is it safe to open a mobile account?
- China Radio and television 5g package is coming, lower than the three major operators, but not as low as expected
- Vscode shortcut key
- Data analysis - promoter evolution analysis
- ThreadLocal的简单理解
猜你喜欢

How vscade sets auto save code

China Database Technology Conference (DTCC) specially invited experts from Kelan sundb database to share

Hubble数据库x某股份制商业银行:冠字号码管理系统升级,让每一张人民币都有 “身份证”

弹性盒子自动换行小Demo

(原创)【MAUI】一步一步实现“悬浮操作按钮”(FAB,Floating Action Button)

程序员坐牢了,会被安排去写代码吗?

thinkphp6 多级控制器目录访问解决方法

To be the Italian Islander? Liuqiangdong cashed out 6.6 billion yuan in two months and made a one-time 560million "emergency transfer" to buy the European maritime Palace

真香啊!最全的 Pycharm 常用快捷键大全!

中国数据库技术大会(DTCC)特邀科蓝SUNDB数据库专家精彩分享
随机推荐
New product experience: Alibaba cloud's new generation of local SSD instance I4 open beta
En parlant d'exception - que se passe - t - il lorsque l'exception est lancée?
简历模板百度网盘自取
ThreadLocal的简单理解
海思35xx实现GT911触摸屏功能「建议收藏」
StackOverflow 2022数据库年度调查
做一个墨水屏电子钟,炫酷!
plt.savefig()的用法以及保存路径
股票网上开户及开户流程怎样?手机开户是安全么?
The difference between align items and align content
List set to array
Centos7——安装mysql5.7
From PDB source code to frame frame object
G1 important configuration parameters and their default values in the garbage collector
Commonly used "redmine" for # test bug
Successful cases of rights protection of open source projects: successful rights protection of SPuG open source operation and maintenance platform
PostgreSQL超越MySQL
thinkphp6 多级控制器目录访问解决方法
我呕血收集融合了来自各路经典shell书籍的脚本教学,作为小白的你快点来吧
PHP crawls web pages for specific information