<?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: Calculating freight cost in a network dataset cost attribute in ArcGIS Network Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-network-analyst-questions/calculating-freight-cost-in-a-network-dataset-cost/m-p/1229644#M8075</link>
    <description>&lt;P&gt;Can you give more details on what you mean by "&lt;SPAN&gt;I did not achieve the expected result"?&amp;nbsp; How was it different from what you expected?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In general, your approach seems correct.&amp;nbsp; You just want to scale the distance by some factor and report that as the freight cost.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My current suspicion is that the spatial reference of your data does not have units of Kilometers.&amp;nbsp; If it's in Meters or decimal degrees or something, the values returned by the Shape or Shape_Length fields will be in those units and not kilometers, so you'll get the wrong values.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You could precompute a field in your source feature classes that has the distance in Kilometers.&amp;nbsp; Or, you could use a function evaluator to combine your freight cost factors with your existing distance attribute that's already in Kilometers (for that case, where the Shape or Shape_Length fields are read directly, the network dataset does the unit conversion for you automatically).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MelindaMorang_0-1667934998609.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/55509i5B46DB9CF7D4DB86/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MelindaMorang_0-1667934998609.png" alt="MelindaMorang_0-1667934998609.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Nov 2022 19:16:47 GMT</pubDate>
    <dc:creator>MelindaMorang</dc:creator>
    <dc:date>2022-11-08T19:16:47Z</dc:date>
    <item>
      <title>Calculating freight cost in a network dataset cost attribute</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/calculating-freight-cost-in-a-network-dataset-cost/m-p/1229542#M8074</link>
      <description>&lt;P&gt;Hello! I have a network dataset with roads and railways (line features) and railway terminals (point feature). I want to calculate the freight cost based on the distance in kilometers. The freight cost is equal the distance multiplied by a constant, that depends on the transport mode.&lt;/P&gt;&lt;P&gt;I've added a freight cost attribute, firstly with an "others" unit and secondly with a "distance - kilometers" unit. I've tried the field script equal to [Shape]*constant and [Shape_Length]*constant, but in all tries I did not achieve the expected result, that would be the distance (in kilometers) multiplied by the constant.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022-11-08 (8).png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/55477iB32855CAC2C798BC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2022-11-08 (8).png" alt="2022-11-08 (8).png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022-11-08 (9).png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/55478iFE8256C680F598D7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2022-11-08 (9).png" alt="2022-11-08 (9).png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Please, could somebody help me and tell me what I'm doing wrong?&lt;/P&gt;&lt;P&gt;Thanks and regards!  &lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 15:52:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/calculating-freight-cost-in-a-network-dataset-cost/m-p/1229542#M8074</guid>
      <dc:creator>ConnieSu</dc:creator>
      <dc:date>2022-11-08T15:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating freight cost in a network dataset cost attribute</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/calculating-freight-cost-in-a-network-dataset-cost/m-p/1229644#M8075</link>
      <description>&lt;P&gt;Can you give more details on what you mean by "&lt;SPAN&gt;I did not achieve the expected result"?&amp;nbsp; How was it different from what you expected?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In general, your approach seems correct.&amp;nbsp; You just want to scale the distance by some factor and report that as the freight cost.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My current suspicion is that the spatial reference of your data does not have units of Kilometers.&amp;nbsp; If it's in Meters or decimal degrees or something, the values returned by the Shape or Shape_Length fields will be in those units and not kilometers, so you'll get the wrong values.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You could precompute a field in your source feature classes that has the distance in Kilometers.&amp;nbsp; Or, you could use a function evaluator to combine your freight cost factors with your existing distance attribute that's already in Kilometers (for that case, where the Shape or Shape_Length fields are read directly, the network dataset does the unit conversion for you automatically).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MelindaMorang_0-1667934998609.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/55509i5B46DB9CF7D4DB86/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MelindaMorang_0-1667934998609.png" alt="MelindaMorang_0-1667934998609.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 19:16:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/calculating-freight-cost-in-a-network-dataset-cost/m-p/1229644#M8075</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2022-11-08T19:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating freight cost in a network dataset cost attribute</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/calculating-freight-cost-in-a-network-dataset-cost/m-p/1229758#M8076</link>
      <description>&lt;P&gt;Hello Melinda! Thanks for your reply!&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I compared both freight costs attributes' results with the length cost attribute's results, and the freight results were related to the shape length, and not with the kilometers (please refer to the picture below).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I ran the route solver again following your advice and achieved the desired results. Thank you for your help!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022-11-08 (10).png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/55535i7872A11870C4FAF8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2022-11-08 (10).png" alt="2022-11-08 (10).png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 01:36:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/calculating-freight-cost-in-a-network-dataset-cost/m-p/1229758#M8076</guid>
      <dc:creator>ConnieSu</dc:creator>
      <dc:date>2022-11-09T01:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating freight cost in a network dataset cost attribute</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/calculating-freight-cost-in-a-network-dataset-cost/m-p/1229821#M8077</link>
      <description>&lt;P&gt;Hello Melinda! I have another problem, could you please help me? I've managed to calculate the freight cost using the following cost attribute:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022-11-09 (4).png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/55559i58ED7B8A0370D000/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2022-11-09 (4).png" alt="2022-11-09 (4).png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'm using a standalone Python script. I've included the command:&lt;/P&gt;&lt;P&gt;route.accumulateAttributeNames = (["Frete2"])&lt;/P&gt;&lt;P&gt;However, the field only appears at arcpy.nax.RouteOutputDataType.Routes, but does not appear at the&amp;nbsp;arcpy.nax.RouteOutputDataType.RouteEdges.&lt;/P&gt;&lt;P&gt;Do you know why? I need this field in both tables, so I can use it in other calculations.&lt;/P&gt;&lt;P&gt;Thanks and regards!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 06:01:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/calculating-freight-cost-in-a-network-dataset-cost/m-p/1229821#M8077</guid>
      <dc:creator>ConnieSu</dc:creator>
      <dc:date>2022-11-09T06:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating freight cost in a network dataset cost attribute</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/calculating-freight-cost-in-a-network-dataset-cost/m-p/1229898#M8079</link>
      <description>&lt;P&gt;Hi! I don't know why, but the results of the freight cost attribute (in Distance units) are under the "Attr_Kilometers", "Cumul_Kilometers", etc. If I want the actual distance in kilometers, then I have to create another length cost attribute (also in Distance units), and its results appear in the fields&amp;nbsp;"Attr_Length", "Cumul_Length", etc. So, problem solved! Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 10:40:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/calculating-freight-cost-in-a-network-dataset-cost/m-p/1229898#M8079</guid>
      <dc:creator>ConnieSu</dc:creator>
      <dc:date>2022-11-09T10:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating freight cost in a network dataset cost attribute</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/calculating-freight-cost-in-a-network-dataset-cost/m-p/1230068#M8080</link>
      <description>&lt;P&gt;The output fields for routes and RouteEdges are documented here:&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/network-analyst/route-output-data-types.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/network-analyst/route-output-data-types.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Fields starting with "Attr_" are input fields and should not appear in the output tables at all, so your further comment confuses me a little.&lt;/P&gt;&lt;P&gt;Anyway, by default, the Route output always includes Minutes, Miles, and Kilometers, but any accumulated attributes will show up as &lt;SPAN&gt;Total_[AccumulateAttributeName]_[Units].&amp;nbsp; Yours should be something like Total_Frete2_Other.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This does not look right:&amp;nbsp;route.accumulateAttributeNames = (["Frete2"]).&amp;nbsp; The parentheses are not necessary.&amp;nbsp; It should be&amp;nbsp;route.accumulateAttributeNames = ["Frete2"].&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 16:57:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/calculating-freight-cost-in-a-network-dataset-cost/m-p/1230068#M8080</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2022-11-09T16:57:12Z</dc:date>
    </item>
  </channel>
</rss>

