Generate Origin Destination Cost Matrix (Ready To Use) in Python Script - Origin names

236
2
Jump to solution
10-18-2021 06:39 AM
CarstenSchuermann
Occasional Contributor

Hi, I want to include the "Generate OD-Cost Matrix (Ready to Use)" tool in a python script. According to the online tool help available at https://pro.arcgis.com/en/pro-app/latest/tool-reference/ready-to-use/itemdesc-generateorigindestinat... it is possible to modify the properties of the origins and destinations. By default, the tool returns the feature IDs of the origins and destinations in the output table. Instead of these IDs I want to get specific codes in the output table in the fields OriginName and DestinationName, respectively. Unfotrunately, the online help does not demonstrate how I can modify the properties of the origins and destinations to accomplish this.

Does anyone have code snippets that show how I can change these properties in a python script?

Thanks, Carsten

 

0 Kudos
1 Solution

Accepted Solutions
MelindaMorang
Esri Regular Contributor

Hi Carsten.

The Ready-To-Use tools will recognize specific fields in the input data and transfer that information to the output. If your input Origins and Destinations have a text field called Name, the values in that field will be included in the output Lines table's OriginName and DestinationName fields. So if you include your specific codes in a field called Name in the inputs, they will get transferred to the outputs the way you want.

Does this answer your question?

View solution in original post

0 Kudos
2 Replies
MelindaMorang
Esri Regular Contributor

Hi Carsten.

The Ready-To-Use tools will recognize specific fields in the input data and transfer that information to the output. If your input Origins and Destinations have a text field called Name, the values in that field will be included in the output Lines table's OriginName and DestinationName fields. So if you include your specific codes in a field called Name in the inputs, they will get transferred to the outputs the way you want.

Does this answer your question?

View solution in original post

0 Kudos
CarstenSchuermann
Occasional Contributor

Hi Melinda,

Thanks for the hint. If everything were that simple. I will try it out right away.

0 Kudos