Solved! Go to Solution.
Streetmap network dataset will open without putting it into a gdb. That is more for when you create your own. But if you really want to put it into a gdb, you can copy and paste in ArcCatalog, and then rebuild the dataset.
I am not able to copy and paste in ArcCatalog (or I don't see how to do it).
But in all the code samples I see - the workspace to open is a gdb. Then open the network dataset from a feature data set included included in the gdb.
Is there any code sample that will just open the streetmap networkdataset directly without going thru a workspace ?
When you mention code samples, are you talking about with python? If so, then I'm not sure how to accomplish what you're wanting.
The code sample for "How to open a network dataset" should work for SDC as well as FGDB. Are you getting an error when you try to use the code sample to open an SDC dataset? What error is it? Can you see your SDC dataset in ArcMap?
The steps from the sample are basically:
Get the IWorkspaceFactory, like they do in Connecting to a geodatabase. However, use "esriDataSourcesFile.SDCWorkspaceFactory"as the ProgID:
public static IWorkspace SDCWorkspaceFromPath(String path)
Type factoryType = Type.GetTypeFromProgID(
IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance
return workspaceFactory.OpenFromFile(path, 0);
Once you have the workspace, you should be able to pass it into OpenNetworkDataset from How to open a network dataset and have it work.
Let me know what errors you are getting and we'll try to work them out. Clipping a FGDB out of SDC is possible, but you lose a lot of information, like turns and signposts.