Publish routing services with the network analysis capability

Routing services allow you to perform network analysis over the web. One of the ways to create a routing service is to publish a map service in ArcGIS Pro with the network analysis capability enabled using the Network Analyst extension.

Learn more about the options for publishing routing services

The first step in creating this type of routing service is to create a map in ArcGIS Pro that contains one or more network analysis layers. Then, publish the map as a service, ensuring that the network analysis capability is enabled. You can consume the resulting service programmatically using ArcGIS web APIs, ArcGIS Maps SDK, or the REST API of the service in a programming language of your choice.

Create a map

Before you can publish a routing service, you need to create a map in ArcGIS Pro that, at a minimum, contains the network analysis layer you will use in your service. You can either add an existing network analysis layer using the Add Data dialog box or create a network analysis layer. This network analysis layer, either imported or created, should use a local network dataset. If it is using a network data source from a portal (either ArcGIS Online or ArcGIS Enterprise), you cannot publish the map as a service with network analysis capability.

Caution:

Publishing and consuming Location-allocation and Vehicle Routing Problem operations are unavailable via map service with network analysis capability. Therefore you should not add Location-allocation and Vehicle Routing Problem layers to your map.

You can edit the properties of the network analysis layers, such as the number of facilities to find in a Closest Facility Analysis Layer or the travel mode to be used as the default for the analysis, in ArcGIS Pro. These properties are used as default values by the published service.

Learn more about network analysis layers

Publish the service

After you have created and saved the map, you can share the map and its layers as a web layer and enable network analysis capability by following the steps below:

  1. On the Share tab, in the Share As group, click Publish Web Layer to open the Share As Web Layer pane.
  2. Complete all the information on the General tab.
  3. Check the Map Image check box under Layer Type.

    Learn more about sharing a map image layer

  4. On the Configuration tab, configure the map image layer properties and enable network analysis capability.
  5. Click the Analyze button at the bottom of the page to analyze any potential errors or warnings.

    Learn more about analyzing resources

  6. Once the validation is successful, click Publish to share your map.

To configure additional properties on the map service see the documentation on editing routing services properties.

Use the service

You can use the routing service to provide specialized or locally hosted routing in your web apps and other desktop scenarios programmatically. ArcGIS developers have many platform choices that work with network analysis services, such as ArcGIS web APIs, ArcGIS Maps SDK, and ArcGIS REST API.

Learn more about the various APIs to access routing services