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 in order 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 first 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 using the Add Data dialog, or create a new network analysis layer based on a network layer (referencing a network dataset) already in the map 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 of the data that it references should be stored in shared network directories so that all server object container (SOC) machines can access them. Additionally, the ArcGIS Server Object Container account must have Read and Write permissions to the directories where the data is stored.

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:

Using the service

You can consume network analysis services using the Web ADF's ArcGIS Server Data Source Library, the ArcGIS Server API, or the service's own Web service description language (WSDL). The Developer Help contains topics and samples that explain in detail how to program with network analysis services.

Network analysis services are always published as extensions of map services. When you work with a map service programmatically, you can access its extensions, one of which is the NAServer extension if you have enabled the Network Analysis capability of the service. NAServer provides access to network analysis functions in a stateless environment.

As an alternative to working with the map service, you can work through the network analysis Web service directly. To access the Web service, you will need to know its URL, which will follow this pattern:

http://<server name>/<instance name>/services/<folder name (if applicable)>/<service name>/mapserver/naserver

For example, if you had a map service Tokyo in the folder Japan running on a machine server1 with the default instance name of "arcgis", the URL of the network analysis service would look like this:

http://server1/arcgis/services/Japan/Tokyo/mapserver/naserver