Network analysis services

Perhaps you've used a Web application that gives you directions between one point and another or lists facilities such as doctors' offices in your neighborhood based on an address you enter. These applications use network analysis on the server to find the appropriate routes and facilities based on the information you provide. You don't need to have any special network analysis software on your machine to get the results you need, because the server does the work for you and returns the results to your machine via a Web service.

Using ArcGIS Server, you can create similar services that perform transportation network analysis operations such as routing, closest facility location, or service area analysis. These services use the Network Analyst Extension to perform analysis on a network dataset. A Network license is required on the server.

Note: Network analysis services cannot be used for performing utility network analysis on a geometric network.

The first step to creating a network analysis service is to use ArcMap to create a map document that contains a network analysis layer. Then, publish the map as a service, ensuring that the Network Analysis capability is enabled. You can consume the resulting service using the developer tools included with ArcGIS Server. The following sections explain these publishing steps in more detail.

Creating the map document

Before you can publish a network analysis 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 new network analysis layer based on a network layer (referencing a network dataset) already in the map by using the Network Analyst toolbar. If you want the service to return an image of the resulting analysis on the map, you should also add whatever other layers you want to see in the map and adjust their symbology accordingly.

You can also use ArcMap to set parameters that will be applied in the analysis by default. These include network locations, such as facilities and barriers, and solver properties, like number of facilities to find and restrictions. For more information about working with network analysis layers in ArcMap, see the Network Analyst section of the ArcGIS Desktop Help.

The map document and all the data that it references should be stored in directories that the server object container (SOC) machines can access. That is, the ArcGIS SOC accounts must have read permissions to the directories where the data is stored. The links between the map and the data break if the ArcGIS SOC account only has permission to read from the directory that contains the map document but not the directory that contains the data referenced by the map.

Network analysis services can be disk intensive, so a recommended performance strategy is to make local copies of the data available on each SOC machine at identical paths. If this is not possible, the data can be placed in a shared network directory.

Publishing the service

After you have created and saved your map document, you can create the network analysis service by following the steps in Publishing a GIS resource to the server. When publishing the resource, keep in mind the following:

For a detailed example of publishing a network analysis service, see Tutorial: Publishing a network analysis service.

Using the service

You can use network analysis services to provide specialized or locally hosted routing in your desktop applications. For example, the Find Route dialog box in ArcMap and the Route dialog box in ArcGIS Explorer are originally configured to access ESRI-hosted network analysis services. If you want to use your own service, either because you have added special rules or data, or because you lack an Internet connection, you can reconfigure these commands to use your own network analysis service. This does not require writing any code.

In Web applications and in other desktop scenarios, network analysis services must be consumed programmatically. ArcGIS developers have many choices of platforms that can work with network analysis services, such as the ArcGIS APIs for JavaScript, Flex, and Silverlight, as well as the ArcGIS Server SOAP and REST APIs. Network analysis on the server is also available through ArcObjects using the coarse-grained object NAServer.

The ArcGIS Server Resource Center links to detailed help for each API. Each help system contains sections about consuming network analysis services. However, the general pattern for working with a network analysis service is the same, regardless of the API:

  1. Get a reference to the network analysis service.
  2. Set up the solver parameters. These include which type of analysis you want to perform and the network locations (for example, stops) to use during the analysis.
  3. Call the Solve method on the network analysis service, passing in the solver parameters.
  4. Work with the results returned from the service. This could include displaying the results on the map or reporting driving directions.

Below are some links to different types of samples that use the network analysis service. The links are organized by API and type of application (Web or desktop).

Web application samples for routing, listed by API

Desktop client samples using the Server API (ArcObjects)

Desktop client samples using SOAP

Network analysis with geoprocessing services

If you're not comfortable writing code, you can still add network analysis functionality to your Web applications through geoprocessing services. A geoprocessing service works from a model that you've built in ModelBuilder. A user submits some input to the geoprocessing service, the model runs on the server, and the results are sent back to the user's machine. The model can include Network Analyst tools that you add from the Geoprocessing menu.

The following examples demonstrate how to set up network analysis tools in a geoprocessing service:

ArcGIS Server Manager provides the Geoprocessing task that helps you use geoprocessing services in your Web applications without writing any code.

Learn more about the Geoprocessing task

Available functionality

Some of the ESRI client APIs vary in the level of complexity that they allow when working with network analysis services. The following table specifies this availability:


Available solvers using network analysis services

Available solvers using geoprocessing services

REST, Flex, JavaScript, Silverlight

Route, Service Area, Closest Facility