從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;
從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;