Skip To Content

Publish a map service with the network analysis capability using ArcMap

Note:

Routing services were referred to as network analysis services prior to 10.8.

Routing services allow ArcGIS Enterprise and ArcGIS Online users to perform network analysis over the web. One of the ways to create a routing service is to publish a map service from ArcMap with the network analysis capability enabled through the Network Analyst extension.

See all options for publishing routing services

The first step in creating this type of routing service using ArcMap is to create a map document that contains a network analysis layer. Then, you publish the map as a service, ensuring that the network analysis capability is enabled. You can consume the resulting service using a variety of ways including ArcGIS Enterprise, ArcGIS Online, and the developer SDKs. The following sections explain this process in more detail.

Creating the map document

Before you can publish a routing service, you need to use ArcMap to create a map document that, at a minimum, contains the network analysis layer you will use in your service. You can either add an existing network analysis layer by using the Add Data dialog box or create a network analysis layer based on a network layer (referencing a network dataset) already in the map by using the Network Analyst toolbar.

You can also use ArcMap to set the default analysis settings for the service. These include network locations, such as facilities and barriers, and solver properties, such as the number of facilities to find any restrictions that apply.

For more information about working with network analysis layers in ArcMap, see the Network Analyst help section.

Publishing the service

After you have created and saved your map document, you can create the routing service by following the steps in the service publishing documentation for ArcMap. When publishing the resource, keep in mind the following:

  • In ArcMap, there are two publishing scenarios: either you copy the data to the server when publishing, or you do not. If you will not be copying data to the server when publishing, you must explicitly give the ArcGIS Server account read permissions to the data referenced by the map document before you publish. If you'll be copying data to the server when publishing, you do not need to grant the ArcGIS Server account permissions to your data. This process is described in detail in the help topic Make your data accessible to ArcGIS Server.

  • When specifying capabilities in the Service Editor, make sure the Network Analysis capability is enabled.

Network Analyst capabilities

The following section describes the capabilities that can be set before publishing the service.

General

Once Network Analysis is enabled, on the Service Editor dialog box, you can click on Network Analysis and specify the below general settings.

  • Output Directory—The location to which result layers are written.

  • Default Output Geometry Precision—This value sets the default precision of the output geometry after generalization. If it is set to zero or not specified, no generalization of output geometry is performed. If it is specified and positive, it represents the MaximumAllowableOffset parameter. Generalization is performed according to IPolycurve.Generalize.

  • Allow users to save result layers on the server—This box specifies whether users can save result layers on the server for future reuse.

  • Save result layer on server when an error occurs—This box specifies whether result layers should automatically be saved in the output directory if there is an error during analysis. If selected, this option may aid in troubleshooting an error.

  • Save result layer on server when debugging—When this box is selected, result layers will automatically be saved in the output directory for every request if the log level is set to DEBUG.

  • Ignore network location fields—This setting tells the service to not use the location fields on the input analysis locations (stops, barriers, facilities, incidents, and so on) if they are passed in with the request. It is useful to ignore network location fields if street names change often, to avoid passing in requests with stale location fields.

Constraints

Constraints are a set of properties that can be defined for each solver to set parameters for your service output. These properties can be set from the Constraints tab. Common to each solver are the following constraints:

  • Max Barriers—The maximum number of point barriers allowed to pass in per request.
  • Max Features intersecting line barriers—The maximum number of streets that can be restricted by line barriers per request.
  • Max Features intersecting polygon barriers—The maximum number of streets that can be restricted by polygon barriers per request.
  • Force Hierarchy Beyond (Extent of Inputs) and Units of Force Hierarchy Beyond (Extent of Inputs)—When stops are a great distance apart, solving requests can require a lot of time and server resources if this option is not selected.

Each solver has additional constraints that can be set:

Route

  • Max Stops—The maximum number of stops that the user is allowed to pass in per request.
  • Allow time windows—This option specifies whether the service supports the user passing in time windows on the input stops.

Service Area

  • Max Facilities—The maximum number of facilities allowed to pass in per request.
  • Max Break and Units of Max Break—The maximum break value that may be specified for a service area request. The impedance units can be based on the following:
    • Time
    • Length
    • Other
  • Force Hierarchy Beyond (Break) and Units of Force Hierarchy Beyond Break—The maximum break value that may be specified for a service area request. After this maximum, the server will automatically change the request to use the network hierarchy.

Closest Facility

  • Max Facilities—The maximum number of facilities allowed to pass in per request.
  • Max Facilities to find—The maximum number of facilities from an incident you want the service to be able to find per request.
  • Max Incidents–The maximum number of incidents allowed to pass in per request.

OD Cost Matrix

  • Max Destinations—The maximum number of destinations allowed to pass in per request.
  • Max Destinations to Find—The maximum number of destinations from an origin you want the service to be able to find per request.
  • Max Origins—The maximum number of origins allowed to pass in per request.

Vehicle Routing Problem

  • Max Orders—The maximum number of orders allowed to pass in per request.
  • Max Routes—The maximum number of routes allowed to pass in per request.

Location Allocation

  • Max Demand Points—The maximum number of demand points allowed to pass in per request.
  • Max Facilities—The maximum number of facilities allowed to pass in per request.

Using the service

You can use the routing services to provide specialized or locally hosted routing in your desktop applications. For example, the Find Route dialog box in ArcMap is originally configured to access a routing service from ArcGIS Online. If you want to use your own service, either because you have added special rules or data or because you don't want to use service credits, you can reconfigure these commands to use your own routing service. This does not require writing any code.

In web applications and other desktop scenarios, routing services must be consumed programmatically. ArcGIS developers have many choices of platforms that can work with network analysis services, such as the ArcGIS web APIs, ArcGIS Runtime SDKs, and REST APIs.

Learn more about the various APIs to access routing services