当前位置:网站首页>Clipping of raster vector data
Clipping of raster vector data
2022-06-28 14:01:00 【kelly1250230225】
Grid clipping (ExtractByMask): Same grid file , Different vector files
# Grid clipping (ExtractByMask): Same grid file , Different vector files
#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()
Grid clipping (ExtractByMask): Same vector file , Different grid files
# Grid clipping (ExtractByMask): Same vector file , Different grid files
#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()
边栏推荐
- Black apple installation tutorial OC boot "suggestions collection"
- Double buffer drawing
- Talk about exception again -- what happens when an exception is thrown?
- Hundreds of lines of code to implement a JSON parser
- Kubernetes 深入理解Kubernetes(二) 声明组织对象
- 原生JS 实现页面元素的拖动 拖拽
- Navicat premium 16 permanent crack activation tool and installation tutorial (available for personal test)
- Is it safe for Huatai Securities to open an account? Is there any risk in opening an account
- i++ , ++i
- 3、项目的整体UI架构
猜你喜欢

外贸邮件推广怎么统计维度

Design artificial intelligence products: technical possibility, user acceptability and commercial feasibility

线程终止的 4 种方式

基于MATLAB的混沌数字图像加密技术研究与仿真实现

Hematemesis recommends 17 "wheels" to improve development efficiency

Open source invites you to participate in openinfra days China 2022. Topic collection is in progress ~

Make an ink screen electronic clock, cool!

抢做意大利岛主?刘强东两月套现66亿 疑一次性5.6亿“紧急转账”急购欧洲海上皇宫

iNFTnews | 科技巨头加快进军Web3和元宇宙

Source code analysis of ArrayList
随机推荐
Explanation of sprintf function in C language
Source code analysis of ArrayList
Nature | mapping the interaction map of plant foliar flora to establish genotype phenotype relationship
Euler equation: a truly perfect formula in the history of mathematics!
中国广电5G套餐来了,比三大运营商低,却没预期那么低
GPS数据格式的分析与处理[通俗易懂]
From PDB source code to frame frame object
初识exception
Ruijie switch configuration SSH password login command [easy to understand]
Operation and maintenance thinking | do you know the relationship between CMDB and monitoring?
等保备案主体是谁?在当地网安进行备案是吗?
PostgreSQL超越MySQL
Kubernetes in-depth understanding of kubernetes (I)
【二叉树】从叶结点开始的最小字符串
木兰开放作品许可证1.0面向社会公开征求意见
PC博物馆-熟悉又陌生的懵懂年代
Reverse a stack with recursive functions and stack operations only
腾讯云国际云服务器登录之后没有网络,如何排查?
【二叉树】在二叉树中分配硬币
你的代碼會說話嗎?(上)