Network analysis in ArcGIS for Server (ArcObjects .NET 10.6 SDK)
ArcObjects Help for .NET developers > Developing with ArcGIS > Learning ArcObjects > Spatial query and analysis > Network analysis > Programming with the ArcGIS Network Analyst extension > Network analysis in ArcGIS for Server (ArcObjects .NET 10.6 SDK)

Network analysis in ArcGIS for Server


In this topic


Working with network analysis on the server

Once you've published the map and enabled the network analysis capability, client applications can send network problems to the server and receive responses that can include routes, driving directions, or any other results produced by the ArcGIS Network Analyst extension solvers.
ArcGIS Desktop users can consume network analysis services out-of-the-box using the Find Route tool, getting simple point-to-point routing without requiring a network license. ArcGIS developers have many platform choices that can work with network analysis services, such as the following:
  • Silverlight, Flex, JavaScript, and application programming interfaces (APIs) for mobile devices
  • ArcGIS Server Simple Object Access Protocol (SOAP)
  • Representational State Transfer (REST) Web service APIs
The ArcGIS for Server Resource Center Web site has 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. The steps are as follows:
  1. Get a reference to the network analysis service.
  2. Set up the solver parameters, including the 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 can include displaying the results on the map or reporting driving directions.

REST

Routing, Closest Facility, and Service Area solvers are accessible through a set of REST endpoints located at http://<server>:6080/arcgis/rest/services.
The general pattern when working with network analysis through REST is as follows:
  1. Set properties that are different from the default.
  2. Set network locations.
  3. Make an HTTP request to the /Solve endpoint.
  4. Use the returned JSON object to get the results of the analysis.
More details can be found in the REST API.

REST and Web APIs

If you're writing a light-weight Web application, you do not have to code against the NAServer REST endpoint from scratch. Instead, you can use the out-of-the-box client side libraries. For more information, see the following:

SOAP

Routing, Closest Facility, Service Area, Location-Allocation, Vehicle Routing Problem, and Origin-Destination Const Matrix solvers are accessible through a set of coarse grained stateless SOAP objects.
The NAServer object is a MapServer server object extension that is capable of performing network analysis through a single, stateless method call. It is used in conjunction with various NAServerSolverParams and NAServerSolverResults objects.
The general pattern when working with server objects is as follows:
  1. Get a reference to an NAServer object either through a MapServer that has an NAServer extension loaded or through an NAServer Web service.
  2. Call NAServer.GetSolverParameters2 to get the NAServerSolverParams object holding the default parameters.
  3. Set properties on the NAServerSolverParams object to configure how you want the analysis to be performed.
  4. Set network locations (for example, Stops) to use in the analysis.
  5. Call NAServer.Solve, passing in the NAServerSolverParams object.
  6. Use the returned NAServerSolverResults object to get at the results of the analysis.
See the SOAP SDK topics for more information.


See Also:

ArcGIS for Server Resource Center
Samples: