AE数据转换的代码

 private void ExportToShapefile(IFeatureClass fc, IWorkspace outWorkspace)
  {

   IDataset inDataSet = fc as IDataset;
   IFeatureClassName inFCName = inDataSet.FullName as IFeatureClassName;
   IWorkspace inWorkspace = inDataSet.Workspace;
  
   IDataset outDataSet = outWorkspace as IDataset;
   IWorkspaceName outWorkspaceName = outDataSet.FullName as IWorkspaceName;
  
   IFeatureClassName outFCName = new FeatureClassNameClass();
   IDatasetName dataSetName = outFCName as IDatasetName;
   dataSetName.WorkspaceName = outWorkspaceName;
   dataSetName.Name = fc.AliasName.ToString();
  

   IFieldChecker fieldChecker = new FieldCheckerClass();
   fieldChecker.InputWorkspace = inWorkspace;
   fieldChecker.ValidateWorkspace = outWorkspace;

   IFields fields = fc.Fields;
   IFields outFields = null;
   IEnumFieldError enumFieldError = null;
   fieldChecker.Validate(fields,out enumFieldError,out outFields);
  
   IFeatureDataConverter featureDataConverter = new FeatureDataConverterClass();
   featureDataConverter.ConvertFeatureClass(inFCName,null,null,outFCName,null,outFields,"",100,0);

  }

posted @ 2008-11-28 16:23  googlegis  阅读(262)  评论(0编辑  收藏  举报

坐标合肥,非典型GIS开发人员 GitHub