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

関連記事

  • この記事を書いた人

羽田 康祐

Esri認定インストラクター、GIS上級技術者、測量士補、潜水士。GISy / GISc とその関連分野である地理学・地図学について日々の出来事で学んだ記憶を記録するためにブログを書いています。行動原理は伊達と酔狂。好きな地形は圏谷。好きな地図投影法はパースクインカンシャル図法。呉市生まれ広島市出身。GIS を使った自己紹介はこちら

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

© 2020 WINGFIELD since1981