操作方法

操作方法:限制起点-目的地分析以基于公共 ID 求解匹配路径

Last Published: July 20, 2023

摘要

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.
  1. Input the source network dataset. To do this, double-click the Input Network Dataset bubble in the model. After this is done, check the accumulators (miles, minutes, etc..) to be appended to the routes to gather the driving distance and time.
  2. Input the destination points.
  3. Select the field that contains the ID from the destinations to be used to match with the origins.
  4. Input the origin points.
  5. Set the SQL expression. This expression can be formatted as:
"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.

  1. Determine the folder location for the saved route results.
  2. Validate the model. If enabled, the entire model is colored.
  3. Run the model. The output is individual shapefiles for all the matching origin and destination routes.
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.  

文章 ID:000012257

从 ArcGIS 专家处获得帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项

相关信息

发现关于本主题的更多内容