zoukankan      html  css  js  c++  java
  • 基于AE连通性分析

    曾经做管线连通性分析,总觉得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 垃圾回收装置
    文件夹同步/备份软件推荐 (SyncToy/FreeFileSync/Compare Advance/GoodSync/Allway Sync/Compare Advance)
    WCF的ABC
    NPOI导出多表头Execl(通过html表格遍历表头)
    分布式应用处理方式
    再探ASP.NET 5(转载)
    应聘.net开发工程师常见的面试题(五)
    应聘.net开发工程师常见的面试题(四)
    应聘.net开发工程师常见的面试题(二)(转载)
    应聘.net开发工程师常见的面试题(一)(转载)
  • 原文地址:https://www.cnblogs.com/wenwu/p/3304382.html
Copyright © 2011-2022 走看看