ArcObjects Library Reference  (NetworkAnalyst)    

INAServer Interface

Provides access to members that perform network analysis in a stateless environment within a MapServer.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Network Analyst Extension.

Members

Description
Method GetNALayerNames Array of network analysis layers of a particular analysis type.
Method GetNetworkDescription Network Dataset DataElement.
Method GetSolverParameters Default solver parameters for the specified network analysis layer.
Method Solve Perform network analysis based on the input solve parameters.

CoClasses that implement INAServer

CoClasses and Classes Description
NAServer A MapServer object extension for performing network analysis within a stateless environment.
NAServerIP NAServer Proxy for IP Messages.
NAServerLP NAServer Proxy for LAN messages.

Remarks

INAServer is the main interface on the NAServer object.  It provides methods to perform network analysis in a stateless manner on a server.

[C#]

This example illustrates connecting to a NAServer web service via a web reference and getting the names of the route layers.

// Assumes you've created a web reference to web service named "SanFrancisco" 
SanFrancisco_NAServer pNAServer = new SanFrancisco_NAServer();
pNAServer.Url = "http://localhost/ArcGIS/Services/SanFrancisco/MapServer/NAServer"; 
// Use NAServer to get analysis layer  names 
string[] routeLayerNames = pNAServer.GetNALayerNames(esriNAServerLayerType.esriNAServerRouteLayer); 


This example illustrates connecting to a NAServer within a map server object named "SanFrancisco" and getting the names of the route layers.

// Connect to ArcGIS Server and get the MapServer's ServerContext
IGISServerConnection pGISServerCon =  new GISServerConnection();  pGISServerCon.Connect("localhost");
IServerObjectManager pSOM = pGISServerCon.ServerObjectManager;
IServerContext pServerContext = pSOM.CreateServerContext("SanFrancisco","MapServer");

// Get the NAServer server object extension
IServerObjectExtensionManager pSOEM = pServerContext.ServerObject as IServerObjectExtensionManager;
INAServer pNAServer = pSOEM.FindExtensionByName("NAServer") as INAServer; 
// Use NAServer to get analysis layer names string[] routeLayerNames = pNAServer.GetNALayerNames(esriNAServerLayerType.esriNAServerRouteLayer);
// Release the context since you're done with it
pServerContext.ReleaseContext();


This demonstrates how to connect to a NAServer object using the ADF web controls and getting the names of the route layers.

//Get the ServerContext from the WebControl and get the MapServer's ServerContext
ServerConnection conn = new ESRI.ArcGIS.Server.WebControls.ServerConnection("localhost",true);
IServerObjectManager pSOM = conn.ServerObjectManager;
IServerContext pServerContext =  pSOM.CreateServerContext("SanFrancisco", "MapServer");\
// Get the NAServer server object extension
IServerObjectExtensionManager pSOEM =   
pServerContext.ServerObject as  IServerObjectExtensionManager;
INAServer pNAServer = pSOEM.FindExtensionByName("NAServer") as INAServer;
// Use NAServer to get analysis layer names
string[] routeLayerNames = pNAServer.GetNALayerNames(esriNAServerLayerType.esriNAServerRouteLayer); 
// Release the context since you're done with it
pServerContext.ReleaseContext();

 


Feedback Send feedback on this page