Posted on 2007-03-08 16:47
帅子 阅读(1157)
评论(0) 编辑 收藏 所属分类:
j2se技术专区
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);
}