Publish Your Own Routing Services

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.

Figure : 1 Routing-service
Figure : 1

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:

publishroutingservices.bat -s https://presales4.esri.in:6443/arcgis -P https://presales4.esri.in:7443/arcgis -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.

Figure : 2 routing-service
Figure : 2

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

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

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

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:

Author : Saranya m

I am an Assistant Manager on the Presales team focused on helping users better understand GeoAI in ArcGIS.

Saranya M Esri India

Next Article

Pothole Detection System Using ArcGIS

Read this article