创建featureclass,为它赋别名,并移动到数据集下
1 if (pOutFtrClass == null) 2 { 3 //continue; 4 //创建featureclass 5 //得到规范的字段集 6 IFields pFields = pFeatureClass.Fields; 7 //在目标工作空间中创建要素类 8 IFieldChecker fieldChecker = new FieldCheckerClass(); 9 IEnumFieldError enumFieldError = null; 10 IFields validatedFields = null; 11 fieldChecker.ValidateWorkspace = pDataset.Workspace; 12 fieldChecker.Validate(pFields, out enumFieldError, out validatedFields); 13 pOutFtrClass = (pDataset.Workspace as IFeatureWorkspace).CreateFeatureClass((pFeatureClass as IDataset).Name, validatedFields, null, null, esriFeatureType.esriFTSimple, "SHAPE", ""); 14 //为此featureclass赋别名 15 IClassSchemaEdit classedit = pOutFtrClass as IClassSchemaEdit; 16 string aliasName = pFeatureClass.AliasName; 17 if (!string.IsNullOrEmpty(aliasName)) 18 { 19 classedit.AlterAliasName(aliasName); 20 } 21 //把此featureclass移动到目标数据集下 22 (pDataset as IDatasetContainer).AddDataset(pOutFtrClass as IDataset); 23 24 }
另,若要在
在sde的工作空间中.CreateFeatureClass需用 esriLicenseProductCode.esriLicenseProductCodeEngineGeoDB许可
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。