导出FeatureClass

AE提供多个gp工具可以实现FeatureClass导出:

1、Feature Class To Shapefile:导出成shp文件时如果字段名称超过10个字节长度会被默认截断

2、Feature Class to Geodatabase:字段中包含esriFieldType.esriFieldTypeString类型,如果字段对应的值特别长,可导出,不报错,但是实际filegdb中无内容

3、FeatureClassToFeatureClass:可实现导出成shp或是filegdb,如果字段中包含esriFieldType.esriFieldTypeString类型,需要设置字段的长度,代码如下:

   public static IField CreateTextField(string pName, string pAliasName, int aWidth)  

       {  

           FieldClass class2 = new FieldClass();  

           IFieldEdit edit = class2;  

           edit.Name_2 = pName.ToUpper();  

           edit.AliasName_2 = pAliasName;  

           edit.Type_2 = esriFieldType.esriFieldTypeString;  

扫描二维码关注公众号,回复: 61925 查看本文章

           edit.Length_2 = aWidth;  

           return class2;  

       } 

然后再导出至filegdb,导出成功!

猜你喜欢

转载自www.cnblogs.com/nygfcn1234/p/8939717.html