【问题标题】:Restricted length of field name限制字段​​名称的长度
【发布时间】:2015-01-06 18:12:46
【问题描述】:

如何取消 10 个字符的限制? 在 shape 文件中实现导出。

创建

IFieldsEdit fieldsEdit = (IFieldsEdit)fields;

// Create field
IField field = new FieldClass();
field.Name_2 = "DATE_CREATED"; // 12 chars
field.Type_2 = esriFieldType.esriFieldTypeString;
field.Length_2 = 20;
fieldsEdit.AddField(field);

var fClass = featureWorkspace.CreateFeatureClass(featureName, fields, null, null,
esriFeatureType.esriFTSimple, "Shape", "");

出来

var f = fClass.CreateFeature(); 

var name = f.Fields.Field[2].Name; // 10 chars
// out name Field: DATE_CREAT
}

因为它显示全名字段?

【问题讨论】:

  • 我认为 10 个字符是 shapefile 的限制。
  • 正确! shapefile 限制为 10 个字符。如何创建图层的本地克隆?

标签: c# arcgis esri


【解决方案1】:

字段名称不能超过 10 个字符。见here。 如果您使用的是 ArcGIS for Desktop,则可以使用字段别名。只需在 IField 上设置 AliasName 属性即可。

【讨论】:

  • AliasName 也有 10 个限制。
  • 是的,我忘记了。 shapefile 中的别名是与字段名称相同的字符串。它们仅在个人、文件和 ArcSDE 地理数据库中受支持。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多