zoukankan      html  css  js  c++  java
  • 遍历图层中的每一个节点(转载)

    Public Sub VisitAllFeature(pLayer As  ILayer)

        Dim pFeatcls As IFeatureClass
        Dim pFeatLayer As IFeatureLayer
        Dim pPointCollection As IPointCollection
        Dim pFeatureCursor As IFeatureCursor
        Dim pFeature As IFeature
        Dim pPoint As IPoint
        Dim i, j As Integer
        Set pFeatLayer = pLayer

        Set pFeatcls = pFeatLayer.FeatureClass
        Dim pQFilt As IQueryFilter
        Set pQFilt = New QueryFilter
        pQFilt.WhereClause = ""

        Set pFeatureCursor = pFeatcls.Search(pQFilt, False)

        Set pFeature = pFeatureCursor.NextFeature
        For i = 0 To pFeatcls.FeatureCount(pQFilt) - 1
            If Not (pFeature Is Nothing) Then
                If
    pFeature.Shape.GeometryType = esriGeometryPoint Then            
    Set pPoint = pFeature.Shape            
    Debug.Print pLayer.Name & " " & pPoint.x & ","
    & pPoint.y
                Else
                  
    Set pPointCollection = pFeature.Shape            
    For j = 0 To pPointCollection.PointCount - 1
                    
    Set pPoint = pPointCollection.Point(j)               
    Debug.Print pLayer.Name & " " & pPoint.x & ","
    & pPoint.y         
    Next j
                End If
            End If
            DoEvents
            Set pFeature =
    pFeatureCursor.NextFeature
        Next i
    End Sub

    转载自:http://bbs.esrichina-bj.cn/esri/viewthread.php?tid=37449

  • 相关阅读:
    Effective C++ 1.让自己习惯C++
    C++Primer 第十九章
    C++Primer 第十八章
    C++Primer 第十七章
    C++Primer 第十六章
    C++Primer 第十五章
    C++Primer 第十四章
    ~~在python中踩过的坑以及问题~~(不断更新)
    ~~Python解释器安装教程及环境变量配置~~
    ~~Py2&Py3~~
  • 原文地址:https://www.cnblogs.com/atravellers/p/1650041.html
Copyright © 2011-2022 走看看