程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> .NET網頁編程 >> C# >> C#入門知識 >> 網絡數據集NetWork Dataset(INetworkDataset)的三種獲取方式

網絡數據集NetWork Dataset(INetworkDataset)的三種獲取方式

編輯:C#入門知識

從geodatabase feature dataset(fds)中獲取網絡數據集

從shapefile workspace (de>shpWSde>)中獲取網絡數據集

  1 IFeatureDatasetExtensionContainer fdsExtCont = fds as IFeatureDatasetExtensionContainer; 2 IFeatureDatasetExtension fdsExt = fdsExtCont.FindExtension(esriDTNetworkDataset); 3 IDatasetContainer2 dsCont = fdsExt as IDatasetContainer2;                    4 IDataset dataset = dsCont.DatasetByName(esriDTNetworkDataset, "Street_ND"); 5 INetworkDataset networkDataset = dataset as INetworkDataset;

 

 

 

 

  IWorkspaceExtensionManager wsExtMgr = shpWS as IWorkspaceExtensionManager;
UID myUID = new UIDClass();
myUID.Value= "esriGeoDatabase.NetworkDatasetWorkspaceExtension";
IWorkspaceExtension wsExt = wsExtMgr.FindExtension(myUID); 
IDatasetContainer2 dsCont = wsExt as IDatasetContainer2;
IDataset dataset = dsCont.DatasetByName(esriDTNetworkDataset, "Street_ND");
INetworkDataset networkDataset = dataset as INetworkDataset;

從SDC workspace (de>sdcWSde>)中獲取網絡數據集

IWorkspaceExtensionManager wsExtMgr = sdcWS as IWorkspaceExtensionManager;UID myUID = new UIDClass();
myUID.Value = "esriGeoDatabase.NetworkDatasetWorkspaceExtension";
IWorkspaceExtension wsExt = wsExtMgr.FindExtension(myUID);
IDatasetContainer2 dsCont = wsExt as IDatasetContainer2;
IDataset dataset = dsCont.DatasetByName(esriDTNetworkDataset, "Street_ND");
INetworkDataset networkDataset = dataset as INetworkDataset;

    

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved