标签:style blog color ar sp div log bs ef
1 //删除要素类. 2 //例如:workspacePath=@"G:\doc\gis\1.400\data\pdb.mdb", featureClassPath="res2_4m". 3 private void featureClass_delete(string workspacePath, string featureClassPath) { 4 ESRI.ArcGIS.Geodatabase.IWorkspaceFactory wsf = new ESRI.ArcGIS.DataSourcesGDB.AccessWorkspaceFactoryClass(); 5 ESRI.ArcGIS.Geodatabase.IWorkspace ws = wsf.OpenFromFile(workspacePath, 0); 6 ESRI.ArcGIS.Geodatabase.IFeatureWorkspace fws = (ESRI.ArcGIS.Geodatabase.IFeatureWorkspace)ws; 7 ESRI.ArcGIS.Geodatabase.IFeatureClass fc = fws.OpenFeatureClass(featureClassPath); 8 //注意的是这里需要为IDataset(IFeatureClass没有删除的功能). 9 ESRI.ArcGIS.Geodatabase.IDataset ds = (ESRI.ArcGIS.Geodatabase.IDataset)fc; 10 ds.Delete(); 11 }
标签:style blog color ar sp div log bs ef
原文地址:http://www.cnblogs.com/listened/p/4058345.html