Hi everybody. Thank you for taking the time in reading this post.
I have some thousands of origins and destinations that I loaded into ArcMap and managed to calculated the shortest path for each pair of ODs.
I would like to be able to export, for each route, the segments in the network dataset that it crosses by ID. E.g., if a route started in segment 1, then would go over segment 3 and it finished within segment 10:
The GP tool CopytraversedSourceFeatures will create a line feature class with the segments in order they were traversed in the shortest route. However this does not work with the OD Cost Matrix solver layer as the OD layer does not retain this information. However you can use the Closest Facility layer, load your Origins as Incidents and the Destinations as Facilities, set the number of facilities to find to the maximum number of facilities you have and solve. This will solve the complete N by M matrix of routes and also generate the paths and then the CopytraversedSourceFeatures tool will create the segment table you need. Try it with a small subset to make sure you understand how the process works. Tool help below:
First, I would never guess that such feature was already built-in.
Secondly, instead of using the Closest Facility layer I took another suggestion of yours in an old 2008 post: to use the Route layer loading departures and stops with the same route ID. That one suits my problem better.