The Configure Network Dataset Live Traffic utility allows you to configure a network dataset to use live traffic data from ArcGIS Online. After you have configured the network dataset with live traffic, you can publish routing services based on this network dataset.
Before running the utility, you should have the following:
- A network dataset that is enabled to work with either TMC- or OpenLR-based live traffic.
Learn more about how to set up the live traffic prerequisites.
- Live traffic extension for your ArcGIS Online subscription.
Contact Esri Customer Service to enable the live traffic extension.
Parameters
You can run the Configure Network Dataset Live Traffic utility using the following parameters:
Parameter | Details |
---|---|
-u | The username for the ArcGIS Online account that is used to get live traffic data from ArcGIS Online. The ArcGIS Online subscription for this account should be licensed for the live traffic extension. |
-p | The password of the user who is specified with the -u parameter. |
-n | The full path to the network dataset. If the network dataset is in a file geodatabase, the value for the -n option should include the path to the file geodatabase, the name of the network dataset, and the name of the feature dataset containing the network dataset. For example, a value for this option can be c:\data\Streets.gdb\Routing\Routing_ND on Windows and /data/Streets.gdb/Routing/Routing_ND on Linux where Streets.gdb is the file geodatabase that has a network dataset named Routing_ND in a feature dataset named Routing. If the network dataset is in a mobile map package, the value for the -n option should include the path to the SQLite database from the folder where the mobile map package was extracted, the name of the network dataset, and the name of the feature dataset containing the network dataset. For example, a value for this option can be c:\street_data\p30\northamerica.geodatabase\Routing\Routing_ND on Windows and /data/street_data/p30/northamerica.geodatabase/Routing/Routing_ND on Linux where northamerica.geodatabase is the SQLite geodatabase that has a network dataset named Routing_ND in a feature dataset named Routing. |
-r | The name of the region for which to get the live traffic data. The valid choices are NorthAmerica, LatinAmerica, Europe, MiddleEastAndAfrica, and AsiaPacific. |
-t | The type of live traffic to be configured on the network dataset. The valid choices are OpenLR and TMC. The default value is OpenLR |
-l | The path to an existing folder for storing traffic cache files when configuring OpenLR-based live traffic. When not specified, the system default folder is used. Tip:The system default might not be located on fast storage on the machine. For best performance, it is recommended that the path specified as the value for this option be located on fast storage on your machine, such as an SSD drive. |
-h | Prints help for the utility. |
Caution:
The tool modifies the input network dataset and creates files in the folder containing the geodatabase with the network dataset. The files with a .traffic extension and .ags extension should be copied along with the network dataset for the live traffic functionality to work. For example, before publishing routing services on a multimachine ArcGIS Server site, ensure that the modified network dataset and the output files are copied to every machine in the site.
Examples
The following examples show how to call the Configure Network Dataset Live Traffic utility on an ArcGIS Server site.
Caution:
If the value for any of the parameters supported by the utility uses the @ character, for example, the password specified using the -p option, you cannot specify the parameter values on the command line. Instead, you should save the parameters in a file and pass the parameters from the file.
Configure a network dataset for North America stored in a file geodatabase with OpenLR live traffic. The live traffic data is set to be downloaded to an existing folder named D:\data\traffic-cache. The example assumes that the ArcGIS Server installation location is C:\Program Files\ArcGIS\Server.
"C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\python.exe" "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcToolBox\Services\routingservices\configure_smp_live_traffic.py" -u username -p secret -n D:\data\NorthAmerica.gdb\Routing\Routing_ND -r NorthAmerica -t OpenLR -l D:\data\traffic-cache
You can call the utility by passing the parameters from a file. This is useful if you are running the utility as part of an automated process or you do not want to type all the options at the command line. To specify the parameters from a file, create a text file and specify each option on a new line. The parameter name and value should be separated using the = sign. A sample file with various options is shown below.
-u=username
-p=secret
-n=D:\data\NorthAmerica.gdb\Routing\Routing_ND
-r=NorthAmerica
-t=OpenLR
-l=D:\data\traffic-cache
To call the tool with the above tool-params.txt file, call the tool and specify the path to the file with the @ symbol.
Caution:
Make sure your file with parameters does not have any extra new lines or white spaces.
"C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\python.exe" "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcToolBox\Services\routingservices\configure_smp_live_traffic.py" @D:\data\tool-params.txt