Skip to Content

Routing Services

Publish Your Own Routing Services

esri india blog

By Saranya M

September 20, 2022

Do you need the functionality of the ArcGIS Online Routing Services in your own infrastructure? This blog discusses the different types of routing services available with ArcGIS Enterprise and how to publish them automatically using ArcGIS Server command line utilities.

Routing services allow you to perform six types of analysis on transportation network and each of them are available as service - Route service (identify optimized route or best route), Closest Facility service, Service Area service, Vehicle Routing Problem service, Location-Allocation service, and Origin Destination Cost Matrix service.

Esri India Blog

Routing services require a network dataset, and you can create a network dataset based on the data your organization maintains. Because they run on ArcGIS Server, routing services make network analysis tools available to your organization on the web, where they can be run by many users simultaneously.

There are multiple ways to publish routing service:

1. A routing service can be published as a map service with network analysis capability (can be used programmatically with ArcGIS APIs and SDKs, but cannot be used from out-of-the-box applications such as ArcGIS Pro)
2. Or as a geoprocessing service – run the tool and publish the result as a webtool (you can use these services from Map Viewer, ArcGIS Pro, or programmatically using ArcGIS APIs or SDKs).

To simplify the process of publishing the routing services, ArcGIS Enterprise includes a utility called “Publish Routing Services utility. This utility takes the network dataset and automates the task of publishing the routing services.

If you are using your own network dataset, ensure the dataset has at least one time-based and one distance-based cost attribute; dataset defines at least one travel mode and supports directions.

The network dataset can be in a file geodatabase, enterprise geodatabase, or a mobile map package. The network dataset should be accessible to all the machines in your server site. You can either keep the file geodatabase in a shared location or preferably copy the network dataset locally on each machine for best performance when running the services.

Now, you can run the “Publish Routing Services utility” which is included in the ArcGIS Server installation. The following parameters will be required:

U user name for a user with publisher or administrative privileges
P password of the user mentioned above
S fully qualified domain name of the machine running ArcGIS Server
P fully qualified domain name of the machine where Portal to which ArcGIS Server site is federated
N full path to the network dataset

The following example shows how to call the Publish Routing Services utility on an ArcGIS Server site that is federated with a portal.

In server machine command prompt, run the publishroutingservices.bat with the necessary credentials as given below:

  • Change directory to “C:\Program Files\ArcGIS\Server\tools\PublishRoutingServices” and run the publishroutingservices.bat file with the appropriate credentials

publishroutingservices.bat -s -P -u portal admin -p secret -o C:\RoutingServices\ServiceDefinitions -n C:\Users\soiadmin\Desktop\NetworkAnalysis\Routing.gdb\ Road_Route_Network\Route Network

The above steps should publish all the routing services as shown below.

Esri India Blog

In ArcGIS Server Manager page, take a look at all the services created by the utility -

  • NetworkAnalysis (Geoprocessing Service) – Asynchronous geoprocessing service
  • NetworkAnalysis (Map Service) – Map service with network analysis capability
  • NetworkAnalysisSync (Geoprocessing Service) – Synchronous geoprocessing service
  • NetworkAnalysisUtilities (Geoprocessing Service) – Service to get travel modes
Esri India Blog

If your ArcGIS Server is federated, the tool registers the routing services as portal utility services.

Esri India Blog

These services can now be used in Map Viewer, ArcGIS Pro as well as in ArcGIS APIs & SDKs.

Esri India Blog

Using Routing Services in Map Viewer

Esri India Blog

Using Routing Services in ArcGIS Pro

Publish Routing Services utility can help users automate the publishing process. The services are similar to directions and routing services available with ArcGIS Online but are based on your own network dataset and run in ArcGIS Enterprise.

Additional resources

See the following links for more information regarding deep learning tools in ArcGIS:

About Author

Saranya M is an Assistant Manager on the Presales – Data Science team and have been with Esri since 2019. She is focused on helping users better understand GeoAI in ArcGIS.

Want to know more?


Find your local Esri India office and get answers for your questions.

Contact Esri India


Search available positions, or contact our human resources team.

Find job opportunities

Give us a call

Talk over the phone