相交的基本思路如下:
检查相交的Python脚本如下,需在ArcGIS 10以上版本中运行 ,最后生成__WT.shp的矢量,即为问题矢量:
import arcpy
#打开覆盖写入
arcpy.env.overwriteOutput=True
A="E:\\zxj\\hh.shp"
fold="E:\\zxj\\"
index=A.rfind("\\")
B=fold+A[index:-4]+"B.shp"
C=fold+A[index:-4]+"C.shp"
D=fold+A[index:-4]+"D.shp"
E=fold+A[index:-4]+"E.shp"
G=fold+A[index:-4]+"G.shp"
#问题区域
prob=fold+A[index:-4]+"__WT.shp"
#关闭结果加入图层
arcpy.env.addOutputsToMap=False
arcpy.FeatureToLine_management(A,B)
arcpy.FeatureToPolygon_management(B,C)
arcpy.Intersect_analysis([C,A],G)
arcpy.FeatureToPoint_management(G, D)
arcpy.FeatureToPoint_management(A, E)
#打开结果加入图层
arcpy.env.addOutputsToMap=True
arcpy.Erase_analysis(E,D,prob)
效果如下。重复只会标记一次,相交会标记两次,重叠标记一次。重叠指一个要素在另一个要素内部
import arcpy
import os
#检查相交或重复的问题
A = r"D:\data\test.shp"
fold = r'D:\data\bb'
#打开覆盖写入
arcpy.env.overwriteOutput=True
index=A.rfind("\\")
B=fold+A[index:-4]+"B.shp"
C=fold+A[index:-4]+"C.shp"
D=fold+A[index:-4]+"D.shp"
E=fold+A[index:-4]+"E.shp"
G=fold+A[index:-4]+"G.shp"
if not os.path.exists(fold):
os.makedirs(fold)
#问题区域 相交的问题
prob=fold+A[index:-4]+"H.shp"
prob2=fold+A[index:-4]+"__WT.shp"
#关闭结果加入图层
arcpy.env.addOutputsToMap=False
arcpy.FeatureToLine_management(A,B)
arcpy.FeatureToPolygon_management(B,C)
arcpy.Intersect_analysis([C,A],G)
arcpy.FeatureToPoint_management(G, D)
arcpy.FeatureToPoint_management(A, E)
arcpy.Erase_analysis(E,D,prob)
#添加字段 问题类型
arcpy.AddField_management(prob, "problem", "TEXT","","", 12)
with arcpy.da.UpdateCursor(prob, "problem") as cursor:
for row in cursor:
row[0] = "相交"
cursor.updateRow(row)
del cursor
#检查重复的问题,根据坐标是否一致判断
#E = r'D:\data\fumz\test\testE.shp'
sets = set()
sets2 = set()
arcpy.AddField_management(E, "problem", "TEXT","","", 12)
fields = ['SHAPE@WKT','problem','SHAPE@X','SHAPE@Y']
with arcpy.da.UpdateCursor(E, fields) as cursor:
for row in cursor:
id = row[0]
id2 = '%s,%s'%(row[2],row[3])
if id in sets:
row[1] = '重复'
cursor.updateRow(row)
elif id2 in sets2:
row[1] = '疑似相交'
cursor.updateRow(row)
else:
cursor.deleteRow()
#cursor.updateRow(row)
sets.add(id)
sets2.add(id2)
del cursor
#打开结果加入图层
arcpy.env.addOutputsToMap=True
#合并图层
arcpy.Merge_management([E, prob], prob2)
#arcpy.env.addOutputsToMap=False
delete = False
#删
if delete:
arcpy.Delete_management(B)
arcpy.Delete_management(C)
arcpy.Delete_management(D)
arcpy.Delete_management(E)
arcpy.Delete_management(G)
arcpy.Delete_management(prob)
# -*- coding: utf-8 -*-
import arcpy
import os
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
#检查相交或重复的问题
shpFolder = r"D:\data\a" #shp文件夹
fold = r'D:\data\a\bc' #输出文件夹
#---------------------分割线-------------------------------
files = [shpFolder+"\\"+i for i in os.listdir(shpFolder) if i.endswith('.shp')]
for A in files:
#打开覆盖写入
A = A.decode('gbk')
arcpy.env.overwriteOutput=True
index=A.rfind("\\")
B=fold+A[index:-4]+"B.shp"
C=fold+A[index:-4]+"C.shp"
D=fold+A[index:-4]+"D.shp"
E=fold+A[index:-4]+"E.shp"
G=fold+A[index:-4]+"G.shp"
if not os.path.exists(fold):
os.makedirs(fold)
#问题区域 相交的问题
prob=fold+A[index:-4]+"H.shp"
prob2=fold+A[index:-4]+"__WT.shp"
#关闭结果加入图层
arcpy.env.addOutputsToMap=False
arcpy.FeatureToLine_management(A,B)
arcpy.FeatureToPolygon_management(B,C)
arcpy.Intersect_analysis([C,A],G)
arcpy.FeatureToPoint_management(G, D)
arcpy.FeatureToPoint_management(A, E)
arcpy.Erase_analysis(E,D,prob)
#添加字段 问题类型
arcpy.AddField_management(prob, "problem", "TEXT","","", 12)
with arcpy.da.UpdateCursor(prob, "problem") as cursor:
for row in cursor:
row[0] = "相交"
cursor.updateRow(row)
del cursor
#检查重复的问题,根据坐标是否一致判断
#E = r'D:\data\fumz\test\testE.shp'
sets = set()
sets2 = set()
arcpy.AddField_management(E, "problem", "TEXT","","", 12)
fields = ['SHAPE@WKT','problem','SHAPE@X','SHAPE@Y']
with arcpy.da.UpdateCursor(E, fields) as cursor:
for row in cursor:
id = row[0]
id2 = '%s,%s'%(row[2],row[3])
if id in sets:
row[1] = '重复'
cursor.updateRow(row)
elif id2 in sets2:
row[1] = '疑似相交'
cursor.updateRow(row)
else:
cursor.deleteRow()
#cursor.updateRow(row)
sets.add(id)
sets2.add(id2)
del cursor
#打开结果加入图层
arcpy.env.addOutputsToMap=True
#合并图层
arcpy.Merge_management([E, prob], prob2)
#arcpy.env.addOutputsToMap=False
delete = True
#删
if delete:
arcpy.Delete_management(B)
arcpy.Delete_management(C)
arcpy.Delete_management(D)
arcpy.Delete_management(E)
arcpy.Delete_management(G)
arcpy.Delete_management(prob)
文章浏览阅读203次。有时候安装mysql后使用mysql命令时报错 Can't connect to MySQL server on localhost (10061),或者用net start mysql 时报服务名无效,一般是因为mysql服务没有启动。这时候可以用管理身份运行cmd.exe(注意必须是管理..._c:\program files\mysql\mysql server 5.6\bin>mysqld --install install/remove
文章浏览阅读6.2k次,点赞3次,收藏44次。亚信联创科技校园招聘B 卷考试时间60_分钟 _考试方式(闭)卷(本试卷满分 100 分,答案请写在答题卡上)请不要在问卷上答题或涂改,笔试结束后请务必交回试卷部分内容分值备注一、计算机基础40分C/C++语言基础40分技能部分二、二选一JAVA 语言基础40分三、数据库20分总分100 分第一部分——计算机基础一、选择题(每题 2 分,总分 40分)1.CPU 状态分为目态和管态两种..._亚信科技java实习笔试题
文章浏览阅读1.3k次。3年对一个程序员来说是非常重要的。像我自己本身就是做程序员的,目前的薪资待遇是13K左右,虽然在我所在的公司不是最高的,但在所在的这个城市的消费水平来说,除了日常的开支,包括房租、水电、伙食、人际交往等费用之外,还能留下一部分闲钱自己存起来。不同城市的薪资待遇是不一样的,这主要是由于当地的消费水平和经济发展水平不同,所以如果你想要更高的薪资待遇,就要考虑在一线城市或者经济发达的城市工作。一个有着丰富工作经验的程序员,他的技能水平、经验和能力都比没有经验的程序员更加出色,所以他们的薪资待遇也会更高一些。_三线城市学java
文章浏览阅读975次。1、camera(depth越小,越先渲染)2、sorting layer(值越小,越先渲染)(下面还有个sortingOrder 值越小,越先渲染)3、渲染队列renderQueue(值越小,越先渲染)4、深度值(距离相机越近该值越小,越远该值越大。)..._unity overlaycamera depth
文章浏览阅读403次。导读:有很多文章出于各种“性能调优”或“安全性”原因,建议禁用 TCP 扩展,本文提供了这些扩展功能的背景,为什么会默认启用,它们之间是如何关联的,以及为什么通常情况下将它们关闭是个坏主意。本文字数:10601,阅读时长大约:16分钟https://linux.cn/article-12710-1.html作者:Florian Westphal译者:XianLei Gao(接上文)TC..._imu 数字时间戳 转换
文章浏览阅读3.5k次,点赞2次,收藏14次。即客户端并不是直接向服务端发起请求,而是会通过一个消息队列,客户端发起请求放入消息队列后就不会去等待服务端的执行结果,而是交给消息队列去下发请求做后台处理,客户端察觉不到。再创建一个监听类,在其中添加监听方法,并定义为Component组件加入Spring中,开启启动类监听队列消息。创建一个监听类,在其中添加监听方法,并定义为Component组件加入Spring中,开启启动类监听队列消息。创建一个监听类,在其中添加监听方法,并定义为Component组件加入Spring中,开启启动类监听队列消息。_rabbitmq消息队列5种模式
文章浏览阅读1k次。RSA 加载公钥时: Caused by: java.security.InvalidKeyException: IOException: DerInputStream.getLength(): lengthTag=127, too big.加载公钥代码段:public static String getPubKeyByCer(String cerPath){String pubKey = "";..._java.security.invalidkeyexception: ioexception : derinputstream.getlength():
文章浏览阅读794次。最近鸿蒙HarmonyOS开发相关的消息非常的火,传言华为系手机后续将不再支持原生Android应用,所以对于原Android应用开发对应的Harmony版本也被一系列大厂提上了日程。作为一个名义上的移动端开发工程师((⊙o⊙)…,最近写python多过Android),当人不让要来学习一波。本次的学习计划是实现一个类微信app效果,计划将常规的app效果都实现一下,以便后续如果需要写Harmony应用,可以直接上手。由于我本人有多年的开发经验和多种语言的开发经验,对于Javascript和。_安卓开发鸿蒙写的优美界面
文章浏览阅读6.1w次,点赞40次,收藏168次。注:如果打开IDEA直接进入到工程界面,可以依次点击File——>Settings——>Appearance & Behavior——>System Settings,不勾选Reopen projects on startup,然后重启IDEA即可。3、选择对应的版本,32位选32-bit Git for Windows Setup,64位选64-bit Git for Windows Setup,点击下载。3、点击文件夹,在bin目录下找到git.exe文件,然后点击OK。,点击Download。_idea配置git
文章浏览阅读387次。Ubuntu 14/16 下Laravel 参照Homestead部署线上环境说明此脚本用于在一台全新的 Ubuntu 14.04 LTS( Ubuntu 16 请使用这个脚本) 上部署适合 Laravel 使用的 LNMP 生产环境。 此脚本参照了 Homestead 环境设置脚本 ,并做了更加适用于生产环境的效率和安全调优。 项目地址:https://github.co..._homestead线上环境
文章浏览阅读886次。qt gamepadThis article is part of a web dev series from Microsoft. Thank you for supporting the partners who make SitePoint possible. 本文是Microsoft的Web开发系列的一部分。 感谢您支持使SitePoint成为可能的合作伙伴。 Gaming on th..._qt gamepad
文章浏览阅读4.2k次。用 Expanded 包裹 row 里的每个组件即可:Row( children: [ Expanded(child: view1), Expanded(child: view2), Expanded(child: view3), ],)_flutter row均分