Ok. What you want is the connectivity matrix of the network graph and the edge costs. You can generate that by using some VBA that I list below. To use this, add the network dataset to ArcMap. Make sure to change the name of the attribute name (in this case I have it as meters) to the one that is in your data. The run it in the VBA. The immedate window will show the results. You can re-format the debug.print lines (change them to write to a file) as needed. The output will currently look like this:Junction: 1 is adjacent to: 1 junctions. Adjacent Junction: 2 Length 235.7Junction: 2 is adjacent to: 3 junctions. Adjacent Junction: 1 Length 235.7 Adjacent Junction: 4 Length 470 Adjacent Junction: 6287 Length 287.8Regards,Jay SandhuPublic Sub List_Adjacent_Junctions()On Error GoTo eh Dim pMxDoc As IMxDocument Set pMxDoc = ThisDocument Dim pNLayer As INetworkLayer Set pNLayer = pMxDoc.FocusMap.Layer(0) Dim pND As INetworkDataset Set pND = pNLayer.NetworkDataset Dim pNQ As INetworkQuery Set pNQ = pND Dim pEnumNE As IEnumNetworkElement Set pEnumNE = pNQ.Elements(esriNETJunction) Dim pNEdge As INetworkEdge Set pNEdge = pNQ.CreateNetworkElement(esriNETEdge) Dim pNEFromJunc As INetworkJunction Set pNEFromJunc = pNQ.CreateNetworkElement(esriNETJunction) Dim pNEToJunc As INetworkJunction Set pNEToJunc = pNQ.CreateNetworkElement(esriNETJunction) Dim pNE As INetworkElement Set pNE = pEnumNE.Next Dim pNEJunc As INetworkJunction Set pNEJunc = pNE Dim i As Integer Do Until pNE Is Nothing Debug.Print "Junction: " & pNEJunc.EID & " is adjacent to: " & pNEJunc.EdgeCount & " junctions." For i = 0 To pNEJunc.EdgeCount - 1 'For each connected edge... pNEJunc.QueryEdge i, True, pNEdge 'Get that connected edge pNEdge.QueryJunctions pNEFromJunc, pNEToJunc 'Get To junction of current edge Debug.Print " Adjacent Junction: " & pNEToJunc.EID & " Length " & pNEdge.AttributeValueByName("Meters") 'List the adjacency Next Set pNE = pEnumNE.Next Loop Exit Subeh: MsgBox "Error: " & Err.DescriptionEnd Sub
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.