Is This Content Helpful?
We're glad to know this article was helpful.
An origin-destination (OD) cost matrix solves from every origin to every destination. In some cases, this is too much and the user may wish to restrict the origins to only route to certain destinations based on a matching ID. Attached is a sample model that helps accomplish this task.
Prior to following the procedure, the Network Analyst extension must be enabled in ArcMap.
This sample model is not supported by Esri Support Services. This is a model to help with this situation and is designed for learning purposes only.
For this model to function, it must be run from the Catalog window in an open .mxd file. In addition, the .mxd file must contain a network dataset and origin / destination point data (with matching IDs).
Download and unzip the 'SampleModel.zip' folder below.
This model only functions properly in Edit mode.
If the ID field is a string, be sure to use '' around %Value%. For example: IDField = '%Value%'
Optionally, after validating the entire model, double-click the 'Field Mapping' parameters to go into each of the 'Add Locations' tools. Set the field map so the NAME field is set to the Unique ID or Name field of the input origin or destination. This makes the output more legible by showing which origin goes to which destination.