private INAContext CreateSolverContext(INetworkDataset networkDataset) { IDENetworkDataset dENetworkDataset = GetDENetworkDataset(networkDataset); INASolver nASolver = new NARouteSolver(); INAContextEdit nAContextEdit = nASolver.CreateContext(dENetworkDataset, nASolver.Name) as INAContextEdit; nAContextEdit.Bind(networkDataset, null); return(nAContextEdit as INAContext); }
//创建网络分析上下文 public static INAContext CreatePathSolverContext(INetworkDataset networkDataset) { IDENetworkDataset deNDS = GetPathDENetworkDataset(networkDataset); INASolver naSolver; naSolver = new NARouteSolver(); INAContextEdit contextEdit = naSolver.CreateContext(deNDS, naSolver.Name) as INAContextEdit; contextEdit.Bind(networkDataset, new GPMessagesClass()); return(contextEdit as INAContext); }
//创建网络分析上下文 public static INAContext CreatePathSolverContext(INetworkDataset networkDataset) { IDENetworkDataset deNDS = GetPathDENetworkDataset(networkDataset); INASolver naSolver; naSolver = new NARouteSolver(); INAContextEdit contextEdit = naSolver.CreateContext(deNDS, naSolver.DisplayName) as INAContextEdit; contextEdit.Bind(networkDataset, new GPMessagesClass());//将网络数据集与网络上下文对象绑定在一起 //GPMessagesClass对象用于记录错误信息。 return(contextEdit as INAContext); }
/// <summary> /// 创建网络分析上下文 /// </summary> public INAContext CreateSolverContext(INetworkDataset networkDataset) { //获取创建网络分析上下文所需的IDENETWORKDATASET类型参数 IDENetworkDataset deNDS = GetDENetworkDataset(networkDataset); INASolver naSolver; naSolver = new NARouteSolver(); INAContextEdit contextEdit = naSolver.CreateContext(deNDS, naSolver.Name) as INAContextEdit; contextEdit.Bind(networkDataset, new GPMessagesClass()); return(contextEdit as INAContext); }