<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: cost matrix in ArcGIS Network Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527585#M5169</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks very much Jay.... I was able to run the code.....However, I notice you are using the Network_Junctions as vertices... my network consists of a road layer and cities_layer (points) ..the latter supposedly is my "vertex" layer. Is there a way to use my cities_ layer as vertices rather than the Network_Junctions so that the distance between cities populates the&amp;nbsp; matrix??. (usually cities_layer does not match with your Junction_layer)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Philip&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Sep 2010 00:18:10 GMT</pubDate>
    <dc:creator>FelipeLillo</dc:creator>
    <dc:date>2010-09-15T00:18:10Z</dc:date>
    <item>
      <title>cost matrix</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527578#M5162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a network dataset which represents roads and a shapefile with cities ....what I wanna do is to generate a cost matrix that contains the distance between two connected cities in the network. For this case the OD_matrix_solver is not desired because it calculates shortest distances between cities.... all I want is the "link_length" between cities..... I've been looking some scripts but most of them just compute euclidean distances between connected points..the question is how I can do the same but using the real shape.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I imagine that analogously to OD_matrix_solver...first I'd have to snap locations to my road network and next to generate the matrix.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone give me a little help here???...thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Sep 2010 01:12:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527578#M5162</guid>
      <dc:creator>FelipeLillo</dc:creator>
      <dc:date>2010-09-13T01:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: cost matrix</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527579#M5163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You start of by saying that you want the distance between two cities and then it is not clear from your post what you need to generate. Can you elaborate on what is "link length" as opposed to "shortest distance" that the OD Cost Matrix generates? OD Cost matrix generates the shortest path distance (route over the network) between the sets of origins and destinations. Not sure what other distance you need. Please elaborate.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jay Sandhu&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Sep 2010 14:12:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527579#M5163</guid>
      <dc:creator>JaySandhu</dc:creator>
      <dc:date>2010-09-13T14:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: cost matrix</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527580#M5164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To make it clearer, you have your network with edges and vertices(cities)... each edge (or link connecting two vertices) has a weight associated (in this case distance "d")....I wanna extract the weight of each link from my map and put them in a matrix like (instead of "ones" I need distances):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="http://cdn.information-management.com/media/editorial/dmreview/200309/200309_068_2.gif" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Sep 2010 21:32:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527580#M5164</guid>
      <dc:creator>FelipeLillo</dc:creator>
      <dc:date>2010-09-13T21:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: cost matrix</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527581#M5165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;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:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Junction: 1 is adjacent to: 1 junctions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Adjacent Junction: 2 Length 235.7&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Junction: 2 is adjacent to: 3 junctions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Adjacent Junction: 1 Length 235.7&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Adjacent Junction: 4 Length 470&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Adjacent Junction: 6287 Length 287.8&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jay Sandhu&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Public Sub List_Adjacent_Junctions()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;On Error GoTo eh&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pMxDoc As IMxDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pMxDoc = ThisDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pNLayer As INetworkLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pNLayer = pMxDoc.FocusMap.Layer(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pND As INetworkDataset&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pND = pNLayer.NetworkDataset&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pNQ As INetworkQuery&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pNQ = pND&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pEnumNE As IEnumNetworkElement&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pEnumNE = pNQ.Elements(esriNETJunction)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pNEdge As INetworkEdge&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pNEdge = pNQ.CreateNetworkElement(esriNETEdge)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pNEFromJunc As INetworkJunction&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pNEFromJunc = pNQ.CreateNetworkElement(esriNETJunction)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pNEToJunc As INetworkJunction&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pNEToJunc = pNQ.CreateNetworkElement(esriNETJunction)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pNE As INetworkElement&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pNE = pEnumNE.Next&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pNEJunc As INetworkJunction&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pNEJunc = pNE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim i As Integer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Do Until pNE Is Nothing&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print "Junction: " &amp;amp; pNEJunc.EID &amp;amp; " is adjacent to: " &amp;amp; pNEJunc.EdgeCount &amp;amp; " junctions."&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = 0 To pNEJunc.EdgeCount - 1&amp;nbsp; 'For each connected edge...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pNEJunc.QueryEdge i, True, pNEdge&amp;nbsp;&amp;nbsp; 'Get that connected edge&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pNEdge.QueryJunctions pNEFromJunc, pNEToJunc&amp;nbsp; 'Get To junction of current edge&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print " Adjacent Junction: " &amp;amp; pNEToJunc.EID &amp;amp; " Length " &amp;amp; pNEdge.AttributeValueByName("Meters") 'List the adjacency&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pNE = pEnumNE.Next&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Loop&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Exit Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;eh:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; MsgBox "Error: " &amp;amp; Err.Description&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Sep 2010 13:49:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527581#M5165</guid>
      <dc:creator>JaySandhu</dc:creator>
      <dc:date>2010-09-14T13:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: cost matrix</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527582#M5166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks very much Jay for you valuable help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Philip&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Sep 2010 21:23:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527582#M5166</guid>
      <dc:creator>FelipeLillo</dc:creator>
      <dc:date>2010-09-14T21:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: cost matrix</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527583#M5167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi JAy ,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been trying to run the code, but my ArcGIS report an "Automation error"...but there is not specification what error is...no error number, nothing....any idea what&amp;nbsp; problem might be??&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;THanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Philip&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;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:&lt;BR /&gt;&lt;BR /&gt;Junction: 1 is adjacent to: 1 junctions.&lt;BR /&gt; Adjacent Junction: 2 Length 235.7&lt;BR /&gt;Junction: 2 is adjacent to: 3 junctions.&lt;BR /&gt; Adjacent Junction: 1 Length 235.7&lt;BR /&gt; Adjacent Junction: 4 Length 470&lt;BR /&gt; Adjacent Junction: 6287 Length 287.8&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Jay Sandhu&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Public Sub List_Adjacent_Junctions()&lt;BR /&gt;On Error GoTo eh&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; Dim pMxDoc As IMxDocument&lt;BR /&gt;&amp;nbsp; Set pMxDoc = ThisDocument&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; Dim pNLayer As INetworkLayer&lt;BR /&gt;&amp;nbsp; Set pNLayer = pMxDoc.FocusMap.Layer(0)&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; Dim pND As INetworkDataset&lt;BR /&gt;&amp;nbsp; Set pND = pNLayer.NetworkDataset&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; Dim pNQ As INetworkQuery&lt;BR /&gt;&amp;nbsp; Set pNQ = pND&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; Dim pEnumNE As IEnumNetworkElement&lt;BR /&gt;&amp;nbsp; Set pEnumNE = pNQ.Elements(esriNETJunction)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; Dim pNEdge As INetworkEdge&lt;BR /&gt;&amp;nbsp; Set pNEdge = pNQ.CreateNetworkElement(esriNETEdge)&lt;BR /&gt;&amp;nbsp; Dim pNEFromJunc As INetworkJunction&lt;BR /&gt;&amp;nbsp; Set pNEFromJunc = pNQ.CreateNetworkElement(esriNETJunction)&lt;BR /&gt;&amp;nbsp; Dim pNEToJunc As INetworkJunction&lt;BR /&gt;&amp;nbsp; Set pNEToJunc = pNQ.CreateNetworkElement(esriNETJunction)&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; Dim pNE As INetworkElement&lt;BR /&gt;&amp;nbsp; Set pNE = pEnumNE.Next&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; Dim pNEJunc As INetworkJunction&lt;BR /&gt;&amp;nbsp; Set pNEJunc = pNE&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; Dim i As Integer&lt;BR /&gt;&amp;nbsp; Do Until pNE Is Nothing&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print "Junction: " &amp;amp; pNEJunc.EID &amp;amp; " is adjacent to: " &amp;amp; pNEJunc.EdgeCount &amp;amp; " junctions."&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = 0 To pNEJunc.EdgeCount - 1&amp;nbsp; 'For each connected edge...&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pNEJunc.QueryEdge i, True, pNEdge&amp;nbsp;&amp;nbsp; 'Get that connected edge&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pNEdge.QueryJunctions pNEFromJunc, pNEToJunc&amp;nbsp; 'Get To junction of current edge&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print " Adjacent Junction: " &amp;amp; pNEToJunc.EID &amp;amp; " Length " &amp;amp; pNEdge.AttributeValueByName("Meters") 'List the adjacency&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pNE = pEnumNE.Next&lt;BR /&gt;&amp;nbsp; Loop&lt;BR /&gt;&amp;nbsp; Exit Sub&lt;BR /&gt;eh:&lt;BR /&gt;&amp;nbsp; MsgBox "Error: " &amp;amp; Err.Description&lt;BR /&gt;End Sub&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Sep 2010 22:20:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527583#M5167</guid>
      <dc:creator>FelipeLillo</dc:creator>
      <dc:date>2010-09-14T22:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: cost matrix</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527584#M5168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;a short update...I was able to fix the "Automation error"...but now I'm gettin a "type mismatch error"...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Philip&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Sep 2010 22:34:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527584#M5168</guid>
      <dc:creator>FelipeLillo</dc:creator>
      <dc:date>2010-09-14T22:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: cost matrix</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527585#M5169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks very much Jay.... I was able to run the code.....However, I notice you are using the Network_Junctions as vertices... my network consists of a road layer and cities_layer (points) ..the latter supposedly is my "vertex" layer. Is there a way to use my cities_ layer as vertices rather than the Network_Junctions so that the distance between cities populates the&amp;nbsp; matrix??. (usually cities_layer does not match with your Junction_layer)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Philip&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Sep 2010 00:18:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527585#M5169</guid>
      <dc:creator>FelipeLillo</dc:creator>
      <dc:date>2010-09-15T00:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: cost matrix</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527586#M5170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can make another point source be part of your network dataset. So you could include the cities to be part of th network. Then change the code to only look at junctions of type cities.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I am not sure how you will get length to the next city with the code I sent as the cities may not be linked to other cities with one to one edges. In fact, your post has again made it un-clear what you are trying to achieve. It looks like all you need is shortest distance between SOME set of cities. How do you determine what cities are connected to a given city? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jay Sandhu&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Sep 2010 14:00:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527586#M5170</guid>
      <dc:creator>JaySandhu</dc:creator>
      <dc:date>2010-09-15T14:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: cost matrix</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527587#M5171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We wanna test a new shortest path algorithm so no optimization is desired at this stage. I'm just using ArcGIS to extract the adjencecy matrix from a real network.... I have a shapeline which represents a road system ...this is built with small polylines ...I additionally have another shapefile (over 2000 points) with represents cities .&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cities are not connected by just one polyline..... many small pieces make the connection among cities. So to get the edge_length between two cities (if they are connected) we have to sum all the small pieces (unless we have a way to merge them into one long polyline)... You are right....the real question is how to find out what cities are connected to a given city.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My idea is to extend your code to firstly identify cities (intead of junctions) and next try to compute adjancency and distance....somehow I'll have to figure out how to keep tracking of the shape_lengh in the road_system.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help will be very appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Philip&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Sep 2010 21:27:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527587#M5171</guid>
      <dc:creator>FelipeLillo</dc:creator>
      <dc:date>2010-09-15T21:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: cost matrix</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527588#M5172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Knowing which city is connected to which city is the key. Without it you can not generate the information. As far as I am concerned, the shortest path between two cities gives you the summed up cost of the links making up the path between the cities. So you can simply use OD for that AND if you want one shape that combines all the shapes making the path, use the Closest Facility Solver. It is same as OD but also returns back the true shape of the path that connects two locations. Hint: You can run CF between all cities and export the resulting paths to a new Feature class and then make network dataset from it. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BTW there is also a GP tool in Network Analyst toolset called DissolveNetwork that will remove all possible two valent junctions from a network dataset (by merging adjacent edges). Perhaps that can be used to simplyfy your network. More info here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Dissolve_Network/00480000000w000000/"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Dissolve_Network/00480000000w000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jay Sandhu&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Sep 2010 13:46:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527588#M5172</guid>
      <dc:creator>JaySandhu</dc:creator>
      <dc:date>2010-09-16T13:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: cost matrix</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527589#M5173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code to compute the adjencecy matrix works very good...is there any way to compute the junctions coordinates (X,Y) through this code???&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Philip&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Dec 2010 05:14:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527589#M5173</guid>
      <dc:creator>FelipeLillo</dc:creator>
      <dc:date>2010-12-25T05:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: cost matrix</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527590#M5174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can get the x,y points of the junctions by querying the from/to junctions. For example, you can:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; dim pFromPoint as IPoint&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; set pFromPoint = new Point&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and then inside the loop after the QueryJunction call:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; pNEFromJunc.QueryPoint pFromPoint&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and now you can access the coordinates:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; debug.print pFromPoint.X&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; debug.print pFromPoint.Y&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;repeat the above for the pNEToJunc&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that is what you wanted.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jay Sandhu&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Dec 2010 16:20:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/cost-matrix/m-p/527590#M5174</guid>
      <dc:creator>JaySandhu</dc:creator>
      <dc:date>2010-12-28T16:20:53Z</dc:date>
    </item>
  </channel>
</rss>

