YouTube | Facebook | Twitter  Feed

ネットワーク解析フィーチャを特定する方法

2016/9/1 (木)

Sub GetResultElements()
    'ユーティリティネットワークエクステンションにアクセスする
    Dim pUtilityNetworkAnalysisExt As IUtilityNetworkAnalysisExt
    Set pUtilityNetworkAnalysisExt = Application.FindExtensionByName("esriEditorext.UtilityNetworkAnalysisExt")
     
    Dim pNetworkAnalysisExt  As INetworkAnalysisExt
    Set pNetworkAnalysisExt = pUtilityNetworkAnalysisExt
     
    Dim pTraceTasks  As ITraceTasks
    Set pTraceTasks = pUtilityNetworkAnalysisExt
 
    Dim pTraceTaskResults As ITraceTaskResults
    Set pTraceTaskResults = pTraceTasks.CurrentTask
 
    Dim junctionEIDs  As IEnumNetEID
    Set junctionEIDs = pTraceTaskResults.ResultJunctions
     
    Dim edgeEIDs As IEnumNetEID
    Set edgeEIDs = pTraceTaskResults.ResultEdges
 
'    Dim pNetworkAnalysisExtResults As INetworkAnalysisExtResults
'    Set pNetworkAnalysisExtResults = pUtilityNetworkAnalysisExt
'
'    Dim junctionEID As Long
'    Dim edgeEID As Long
'
'    junctionEIDs.Reset
'    junctionEID = junctionEIDs.Next
'
'    Do Until junctionEID = 0
'
'        Debug.Print "Junction", junctionEID
'        junctionEID = junctionEIDs.Next
'    Loop
'
'    edgeEID = edgeEIDs.Next
'    edgeEIDs.Reset
'    Do Until edgeEID = 0
'
'        Debug.Print "Edge", edgeEID
'        edgeEID = edgeEIDs.Next
'    Loop
    
     
    Dim pEIDHelper As IEIDHelper
    Set pEIDHelper = New EIDHelper
    pEIDHelper.ReturnFeatures = True
    Set pEIDHelper.GeometricNetwork = pNetworkAnalysisExt.CurrentNetwork
     
    Dim pEnumEIDInfo As IEnumEIDInfo
     
    'ジャンクションの取得
    Set pEnumEIDInfo = pEIDHelper.CreateEnumEIDInfo(junctionEIDs)
    pEnumEIDInfo.Reset
     
    Dim pEIDInfo As IEIDInfo
    Set pEIDInfo = pEnumEIDInfo.Next
 
    Do Until pEIDInfo Is Nothing
        Debug.Print "Junction", pEIDInfo.Feature.OID
        Set pEIDInfo = pEnumEIDInfo.Next
    Loop
     
    'エッジの取得
    Set pEnumEIDInfo = pEIDHelper.CreateEnumEIDInfo(edgeEIDs)
    pEnumEIDInfo.Reset
     
    Set pEIDInfo = pEnumEIDInfo.Next
         
    Do Until pEIDInfo Is Nothing
        Debug.Print "Edge", pEIDInfo.Feature.OID
        Set pEIDInfo = pEnumEIDInfo.Next
    Loop
 
End Sub

関連記事

  • この記事を書いた人

羽田 康祐

好きな地図投影法 はパース・クィンカンシャル図法とマクブライド・トーマス平極四次曲線図法。広島市出身。GIS上級技術者、Esri認定インストラクター、測量士補、潜水士、元PADIダイブマスター、四アマ。GIS を使った自己紹介はこちら。ESRIジャパン(株)所属、発言は個人の見解です。

-プログラミング, ArcGIS
-,

© 2021 WINGFIELD since1981