AnsweredAssumed Answered

Create a shapefile from inMemory workspace

Question asked by nasir_siddique on Dec 17, 2017

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 gets failed 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 shapefile
using InMemory workspace. The shapefile creates sucessfully and now I need to create the Shapefile
on disk. Can someone help me in creating the shapefile on a disk from InMemory workspace?

Outcomes