• 遍历图层中的每一个节点(转载)


    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

  • 相关阅读:
    junit4
    spring
    hibernate 的注意事项
    Struts2 的 命名规范
    Struts2 的标签
    OGNL
    添加删除 板块 struts2
    Struts2 的各种xml 和struts 配置信息 都是一样的
    struts2
    struts2
  • 原文地址:https://www.cnblogs.com/atravellers/p/1650041.html
Copyright © 2020-2023  润新知