HOW TO
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.
Warning: 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.
Note: This model only functions properly in Edit mode.Right-click and edit the model 'Selective_ODCost_Matrix' and follow the steps as written in the model.
"Your_ID_Field = %Value%"
Note: If the ID field is a string, be sure to use '' around %Value%. For example: IDField = '%Value%'
This sets a query on the origins to only load points that match the unique selection from the iterator.
Note: 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.
Article ID: 000012257
Get help from ArcGIS experts
Download the Esri Support App