<?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: OD Cost Matrix Different results between ArcMap and Python in ArcGIS Network Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556944#M5411</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Melinda,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the make OD cost matrix code - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/****************************/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Sets the location of the network dataset and the name of the OD Cost Matrix&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inNetworkDataset = "Drive:\NetworkAnalysisTesting\Network_w_Time_NAD83.gdb\Updated_LenMin_ND\Streets_Updated_LenMin_ND_ND"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; outNALayerName = "OD_Cost_Matrix"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; impedanceAttribute = "Length_Miles_Recalc"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; searchTolerance = "5000 Meters"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; odOrigins = "Origins"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Create a new OD cost matrix analysis layer. For this scenario, the default &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #value for all the remaining parameters satisfies the analysis requirements&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "I am about to make an OD Layer"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; outNALayer = arcpy.na.MakeODCostMatrixLayer(inNetworkDataset, outNALayerName,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; impedanceAttribute,"",3,"Length_Miles_Recalc;Minutes_recalc","ALLOW_UTURNS","Oneway")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the load locations code&lt;/P&gt;&lt;P&gt;/*******************************************/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Load origins as destinations&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "I am about to load the destinations - " + inDestinationName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.na.AddLocations(outNALayer,destinationsLayerName,inDestinationFeatures,"Name UniqueRecordID #", searchTolerance,"UniqueRecordID","Streets_Updated_LenMin SHAPE;Streets_Updated_LenMin_ND_ND_Junctions NONE","MATCH_TO_CLOSEST","CLEAR","NO_SNAP","#","INCLUDE")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Load Destinations complete"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Load origins &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "I am about to load the Origins - " + inOriginName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.na.AddLocations(outNALayer,originsLayerName,inOriginFeatures,"Name UniqueID #",searchTolerance,"UniqueID","Streets_Updated_LenMin SHAPE;Streets_Updated_LenMin_ND_ND_Junctions NONE","MATCH_TO_CLOSEST","CLEAR","NO_SNAP","#","INCLUDE") &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Load Origins complete"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Sep 2015 15:16:25 GMT</pubDate>
    <dc:creator>MatthewCieri</dc:creator>
    <dc:date>2015-09-24T15:16:25Z</dc:date>
    <item>
      <title>OD Cost Matrix Different results between ArcMap and Python</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556937#M5404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on automating OD cost matrix runs and am trying to figure out why running the data in arcpy gives a significantly different result then when run in arcmap. I have checked every setting (i believe) and they all seem to be the same.&amp;nbsp; It uses the same network and the same origins and destinations. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At first i thought it might have been a projection issue and i have tested the runs with everything in the same projection and still the results are different. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any idea on why this would be?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 13:07:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556937#M5404</guid>
      <dc:creator>MatthewCieri</dc:creator>
      <dc:date>2015-09-24T13:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: OD Cost Matrix Different results between ArcMap and Python</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556938#M5405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to upload a small sample of your data, a map document with your solved od cost matrix layer,&amp;nbsp; and script that I can use to take a closer look at this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 13:36:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556938#M5405</guid>
      <dc:creator>FreddieGibson</dc:creator>
      <dc:date>2015-09-24T13:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: OD Cost Matrix Different results between ArcMap and Python</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556939#M5406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am sorry but I can't for this data.&amp;nbsp; The only other variable i can think if is the data is being run is a query layer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 13:38:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556939#M5406</guid>
      <dc:creator>MatthewCieri</dc:creator>
      <dc:date>2015-09-24T13:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: OD Cost Matrix Different results between ArcMap and Python</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556940#M5407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would assume that there is something different between your solver in ArcMap and your solver in your standalone python application. I would suggest running your standalone code in the python window of a new blank session of ArcMap so that you can verify the data in the same environment. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 13:53:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556940#M5407</guid>
      <dc:creator>FreddieGibson</dc:creator>
      <dc:date>2015-09-24T13:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: OD Cost Matrix Different results between ArcMap and Python</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556941#M5408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have never done python in the python window.&amp;nbsp; Would what you are suggesting just be a copy paste and run?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 14:06:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556941#M5408</guid>
      <dc:creator>MatthewCieri</dc:creator>
      <dc:date>2015-09-24T14:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: OD Cost Matrix Different results between ArcMap and Python</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556942#M5409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Freddie,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did as you suggested and ran the script standalone, in the python window and in arcmap and it seems it may not be the solver.&amp;nbsp; ArcMap loads and finds a few more destinations then when the loading happens in python.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 15:00:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556942#M5409</guid>
      <dc:creator>MatthewCieri</dc:creator>
      <dc:date>2015-09-24T15:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: OD Cost Matrix Different results between ArcMap and Python</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556943#M5410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm guessing that the problem is most likely one of the following:&lt;/P&gt;&lt;P&gt;- In your python code, when you run arcpy.na.MakeODCostMatrixLayer(), you aren't feeding it exactly the same parameters as the layer you have in ArcMap (where many of the parameters are set to defaults).&amp;nbsp; So maybe you have a different impedance attribute, or some restrictions are toggled differently.&lt;/P&gt;&lt;P&gt;- When you add your origins and destinations, maybe the field mapping isn't working the same as it is in ArcMap.&amp;nbsp; In ArcMap, it's super easy to use the field mapping control on the Load Locations dialog.&amp;nbsp; In python, you need to use either a correctly formatted text string or an arcpy.na.NAClassFieldMappings() object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know you can't upload your data, but can you upload a snippet of your python code?&amp;nbsp; Otherwise, it's virtually impossible to diagnose this problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 15:05:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556943#M5410</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2015-09-24T15:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: OD Cost Matrix Different results between ArcMap and Python</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556944#M5411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Melinda,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the make OD cost matrix code - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/****************************/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Sets the location of the network dataset and the name of the OD Cost Matrix&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inNetworkDataset = "Drive:\NetworkAnalysisTesting\Network_w_Time_NAD83.gdb\Updated_LenMin_ND\Streets_Updated_LenMin_ND_ND"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; outNALayerName = "OD_Cost_Matrix"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; impedanceAttribute = "Length_Miles_Recalc"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; searchTolerance = "5000 Meters"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; odOrigins = "Origins"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Create a new OD cost matrix analysis layer. For this scenario, the default &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #value for all the remaining parameters satisfies the analysis requirements&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "I am about to make an OD Layer"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; outNALayer = arcpy.na.MakeODCostMatrixLayer(inNetworkDataset, outNALayerName,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; impedanceAttribute,"",3,"Length_Miles_Recalc;Minutes_recalc","ALLOW_UTURNS","Oneway")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the load locations code&lt;/P&gt;&lt;P&gt;/*******************************************/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Load origins as destinations&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "I am about to load the destinations - " + inDestinationName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.na.AddLocations(outNALayer,destinationsLayerName,inDestinationFeatures,"Name UniqueRecordID #", searchTolerance,"UniqueRecordID","Streets_Updated_LenMin SHAPE;Streets_Updated_LenMin_ND_ND_Junctions NONE","MATCH_TO_CLOSEST","CLEAR","NO_SNAP","#","INCLUDE")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Load Destinations complete"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Load origins &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "I am about to load the Origins - " + inOriginName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.na.AddLocations(outNALayer,originsLayerName,inOriginFeatures,"Name UniqueID #",searchTolerance,"UniqueID","Streets_Updated_LenMin SHAPE;Streets_Updated_LenMin_ND_ND_Junctions NONE","MATCH_TO_CLOSEST","CLEAR","NO_SNAP","#","INCLUDE") &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Load Origins complete"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 15:16:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556944#M5411</guid>
      <dc:creator>MatthewCieri</dc:creator>
      <dc:date>2015-09-24T15:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: OD Cost Matrix Different results between ArcMap and Python</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556945#M5412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmm, well, none of that looks problematic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you describe the differences you're seeing between the python results and ArcMap?&amp;nbsp; Is one showing considerably longer distances than the other, or are the results just different all over the place?&amp;nbsp; Are the results in ArcMap identical each time you run Solve in ArcMap, and are the results in python identical every time you run Solve in python?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 15:40:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556945#M5412</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2015-09-24T15:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: OD Cost Matrix Different results between ArcMap and Python</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556946#M5413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Melinda,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the end of the process i split the name at the dash and join up other data based on the ID.&amp;nbsp; Then I take the first destination and find all records that were within 5, 15 miles and 12 and 35 minutes and get a count.&amp;nbsp; These counts are different between python and ArcMap.&amp;nbsp; If i input the same origins and destinations i would expect that the distances returned would be the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes i get the same answer with different runs in python using the same data. I haven't checked this in ArcMap but based on past runs i believe i do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also not sure if you caught that i wrote when i load the data in python there are some records that are not located on the network but when i load them in arcmap they are located.&amp;nbsp; This leads me to lean towards there being something with the add locations but i am not sure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 15:51:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556946#M5413</guid>
      <dc:creator>MatthewCieri</dc:creator>
      <dc:date>2015-09-24T15:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: OD Cost Matrix Different results between ArcMap and Python</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556947#M5414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What you just said in your last paragraph above sounds very suspicious to me, so I'm inclined to agree that it sounds like an Add Locations problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe it's a search_criteria syntax problem.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Your input: "Streets_Updated_LenMin SHAPE;Streets_Updated_LenMin_ND_ND_Junctions NONE"&lt;STRONG&gt;​&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I would have thought that syntax would be okay (because often the semi-colon-separated strings are interpreted the same way as lists in arcpy), although the &lt;A href="http://http//resources.arcgis.com/EN/HELP/MAIN/10.2/index.html#//004800000005000000"&gt;doc&lt;/A&gt; tells you to enter it in as a list of lists.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Doc: [["&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Streets_Updated_LenMin&lt;/SPAN&gt;","SHAPE"], ["&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Streets_Updated_LenMin_ND_ND_Junctions&lt;/SPAN&gt;","NONE"]]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Maybe try that?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Also, are you sure that "&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Streets_Updated_LenMin_ND_ND_Junctions" is actually the name of your junction source, or is that a typo?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Finally, when using search_criteria in Add Locations, you have to put something for all your network dataset sources.&amp;nbsp; It's unclear what the behavior is if you have, for instance, multiple edge sources, but you only specify the behavior of one of them.&amp;nbsp; So, are all your network dataset source feature classes accounted for in the search_criteria above?&amp;nbsp; If not, put something for all of them, and see if that helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 16:29:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556947#M5414</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2015-09-24T16:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: OD Cost Matrix Different results between ArcMap and Python</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556948#M5415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Melinda,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will look into the syntax but that is the syntax that gets exported from model builder.&amp;nbsp; If I am doing something with many options i will sometimes create a sample in modelbuilder to see what the syntax should be.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I may have found the issue and I think it has to do with the query layers as my inputs. I exported my data as file geodatabase feature classes and ran them through both arcmap and my python code and I got the same result.&amp;nbsp; I want to try and perform this on my full datasets to confirm my results. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this really is the case that query layers are causing the problem then this is going to add a bunch of processing time to my project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts on why query layers would cause a problem. They visually look good and perform pretty well in arcmap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for looking into this with me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 17:07:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556948#M5415</guid>
      <dc:creator>MatthewCieri</dc:creator>
      <dc:date>2015-09-24T17:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: OD Cost Matrix Different results between ArcMap and Python</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556949#M5416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure what tool/syntax you're using for your layer query.&amp;nbsp; Can you post another python code snippet?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 17:10:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556949#M5416</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2015-09-24T17:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: OD Cost Matrix Different results between ArcMap and Python</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556950#M5417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is pretty simple tool to use so i don't see where there could be an issue but here it is. Also it fails if i have something wrong here like i have the database name wrong.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;inOriginName = rec&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inSQLQueryRec = "Select * from PCPToRecipRatio.dbo." + rec&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print inSQLQueryRec&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inOriginFeatures = arcpy.MakeQueryLayer_management(inOriginRecipientsFilePath,rec,inSQLQueryRec,"UniqueID","POINT")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inDestinationName = prov&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inSQLQueryProv = "Select * from PCPToRecipRatio.dbo." + prov&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print inSQLQueryProv&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inDestinationFeatures = arcpy.MakeQueryLayer_management(inDestinationProvidersFilePath,prov,inSQLQueryProv,"UniqueRecordID","POINT")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 17:18:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556950#M5417</guid>
      <dc:creator>MatthewCieri</dc:creator>
      <dc:date>2015-09-24T17:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: OD Cost Matrix Different results between ArcMap and Python</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556951#M5418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This might still be a syntax problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Technically, an arcpy geoprocessing tool call produces a "Result object".&amp;nbsp; Sometimes you can pass that result object in as input for another tool, and the other tool is able to figure out what to do with it.&amp;nbsp; However, a more correct thing to do would be to retrieve the tool's actual output and pass that output as input to another tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;inDestinationName = prov&lt;/P&gt;&lt;P&gt;inSQLQueryProv = "Select * from PCPToRecipRatio.dbo." + prov&lt;/P&gt;&lt;P&gt;print inSQLQueryProv&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca;"&gt;inDestinationFeatures&lt;/SPAN&gt; = arcpy.MakeQueryLayer_management(inDestinationProvidersFilePath,prov,inSQLQueryProv,"UniqueRecordID","POINT")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.na.AddLocations(outNALayer,destinationsLayerName,&lt;SPAN style="color: #3334ca;"&gt;inDestinationFeatures&lt;/SPAN&gt;,"Name UniqueRecordID #", searchTolerance,"UniqueRecordID","Streets_Updated_LenMin SHAPE;Streets_Updated_LenMin_ND_ND_Junctions NONE","MATCH_TO_CLOSEST","CLEAR","NO_SNAP","#","INCLUDE")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suggestion:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca;"&gt;inDestinationFeatures&lt;/SPAN&gt; = arcpy.MakeQueryLayer_management(blahblahblah)&lt;SPAN style="color: #e23d39;"&gt;.getOutput(0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other suggestion:&lt;/P&gt;&lt;P&gt;Instead of using the output layer object from MakeQueryLayer, try just passing the layer's string name. This also tends to work.&lt;/P&gt;&lt;P&gt;arcpy.na.AddLocations(outNALayer,destinationsLayerName,&lt;SPAN style="color: #3334ca;"&gt;prov&lt;/SPAN&gt;,...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 18:04:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556951#M5418</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2015-09-24T18:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: OD Cost Matrix Different results between ArcMap and Python</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556952#M5419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i will try the getOutput(0) idea but the string name doesn't work.&amp;nbsp; The passing of string name is what lead me down the query layer path when i first started this. It kept say layer was invalid (or something along those lines).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for all your help and thoughts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some of these things seem so simple to implement but after running you notice issues popping up even though everything was "successful"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 18:13:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556952#M5419</guid>
      <dc:creator>MatthewCieri</dc:creator>
      <dc:date>2015-09-24T18:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: OD Cost Matrix Different results between ArcMap and Python</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556953#M5420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Happy to try to help.&amp;nbsp; I've never used the MakeQueryLayer tool before, so everything I said was just a guess.&amp;nbsp; If that doesn't work for you, you're best bet is to contact &lt;A href="http://http//support.esri.com/en/"&gt;Support &lt;/A&gt;and to get one of them working on it.&amp;nbsp; I think I've about reached the limit of what I can advise on GeoNet.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 18:19:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/od-cost-matrix-different-results-between-arcmap/m-p/556953#M5420</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2015-09-24T18:19:43Z</dc:date>
    </item>
  </channel>
</rss>

