Calculates the shortest route between a set of points in a pre-defined order along a Bidirectional Network (BDN) using Dijkstra's algorithm. The "shortest" route can refer to different variables (distance, time, etc.) depending what cost was used for building the reference network. The points will be used in their order in the input layer. The order can be changed if the Sort Field parameter is used.
Results from the Shortest Path function - Network created with no cost field - length of the street segments used as cost.
Results from the Shortest Path function - Network created Cost = "Minutes" - the results represents the quickest routes.
Parameters
Expression | Explanation |
---|---|
Function Name | ShortestPath |
<Network to Use> | A String - the full name of the Network file (.etn). |
<Input Points> | A String representing the input layer. Must be of Point type. |
<output dataset> | A String - the full name of the output layer. |
<snap tolerance> | A Double representing the snap tolerance(in the units of the spatial reference of the Network). |
{Input Barrier Points} | A String representing the input layer with barrier points. Must be of Point type. |
{Barriers Direction Field} | A String representing the name of the field in the Input Barrier Points that will indicate the direction in which the barrier defined by each point work . Must be of String type. |
{Sort Field} | A String representing the Name of the field to be used to sort the points of the Input Point layer to establish the sequence in which they will be visited. |
{Sort Direction} | A String - the sort direction. Valid values.
|
ETGWPath used in the table below is the full path to ETGWRun.exe (E.G. "C:\Program Files\ETSpatial Techniques\ETGeo Wizards\ETGWRun.exe")
Language | Syntax |
---|---|
Python | subprocess.call([ETGWPath, "ShortestPath", "Network to Use", "Input Points", "output dataset","snap tolerance", "Input Barrier Points", "Barriers Direction Field", "Sort Field" "Sort Direction"]) |
.NET using ETGWRun.exe | StartInfo.FileName = ETGWPath StartInfo.Arguments = "ShortestPath" "Network to Use" "Input Points" "output dataset" "snap tolerance" "Input Barrier Points" "Barriers Direction Field" "Sort Field" "Sort Direction" |
.NET using ETGWOutX.dll | ShortestPath(Network to Use,Input Points, output dataset, snap tolerance,Input Barrier Points, Barriers Direction Field Sort Field,Sort Direction) |
ArcPy | arcpy.ShortestPath(Network to Use,Input Points, output dataset, snap tolerance, Input Barrier Points, Barriers Direction Field, Sort Field, Sort Direction) |
Notes:
<> - required parameter
{} - optional parameter
The argument separator for StartInfo.Arguments is space. If a string might contain a space, you need to double quote it.