首页 技术 正文
技术 2022年11月11日
0 收藏 988 点赞 3,852 浏览 1552 个字

曾经做管线连通性分析,总觉得ARCGIS应该有现成的方案可以实现,但最终没有找到,后来只好自己写了套代码,但在搜索过程中找到了这样一估代码,当时留了下来,那我现在也把它留下来。

Dim pLayer As ILayer
pLayer = Map1.get_Layer(1)
Dim pGeoFeature As IGeoFeatureLayer
pGeoFeature = pLayer
Dim pQueryFilter As IQueryFilter
pQueryFilter = New QueryFilter
pQueryFilter.WhereClause = "FID<3"
Dim pCursor As IFeatureCursor
pCursor = pGeoFeature.Search(pQueryFilter, False)
Dim pFeature As IFeature
pFeature = pCursor.NextFeature
Do While Not pFeature Is Nothing
Dim pLine As IPolyline
pLine = New Polyline
pLine = pFeature.Shape
Dim pPointCollection As IPointCollection
pPointCollection = pLine
Dim pConstructgeometrycollection As IConstructGeometryCollection
pConstructgeometrycollection = New GeometryBag
pConstructgeometrycollection.ConstructDivideEqual(pLine, 40, esriConstructDivideEnum.esriDivideIntoPolylines)
Dim pEnumGeometry As IEnumGeometry
pEnumGeometry = pConstructgeometrycollection
pLine = pEnumGeometry.Next()
Dim psimpleMark As ISimpleMarkerSymbol
psimpleMark = New SimpleMarkerSymbol
psimpleMark.Size = 2
psimpleMark.Style = esriSimpleMarkerStyle.esriSMSCircle
‘——————一条线的起点—————————-
Dim PointTO As IPoint
PointTO = New Point
PointTO = pLine.FromPoint
Map1.DrawShape(PointTO, psimpleMark)
‘———————————————————-
pEnumGeometry.Reset()
For I = 1 To pEnumGeometry.Count – 1
pLine = pEnumGeometry.Next
pLine.QueryToPoint(PointTO)
‘Map1.DrawShape(PointTO, psimpleMark)
Next I
‘——————一条线的终点—————————-
pLine = pEnumGeometry.Next
pLine.QueryToPoint(PointTO)Map1.DrawShape(PointTO, psimpleMark)
‘——————————————————-
pFeature = pCursor.NextFeature
Loop

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,086
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,561
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,410
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,183
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,820
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,903