I am trying to convert a raster dataset into a shapefile using IConversionOp.RasterDataToPolygonFeatureData API.
See the code below:
IConversionOp conversionOp = new RasterConversionOp() as IConversionOp;
IWorkspaceFactory inMemoryWorkSpaceFactory = new InMemoryWorkspaceFactory();
IWorkspaceName inMemoryWorkspaceName = inMemoryWorkSpaceFactory.Create("", "MyWorkspace", null, 0);
IName name = (IName)inMemoryWorkspaceName;
IWorkspace inMemoryWorkspace = (IWorkspace)name.Open();
conversionOp.RasterDataToPolygonFeatureData(rasterDataset as IGeoDataset,
inMemoryWorkspace, inMemoryWorkspace.PathName, false);
I am using InMemory as RasterDataToPolygonFeatuerData
fails when the path argument has spaces and I do have fair chances to have spaces in the output path.
So I tried to create the FeatureClass using InMemory workspace. The FeatureClass gets created successfully and now I need to create the Shapefile on disk.
Can someone help me in creating the Shapefile on a disk from InMemory workspace?