转自原文 ArcGIS Engine 创建索引(属性索引)——提高查询效率

 

众所周知,建立索引可以提高查询的效率,当对FeatureClass中的某一列频繁的查找,且数据量比较大时,建立索引是非常有必要的。

这里介绍一下,用 ArcGIS Engine 来建立一个属性索引。

    IIndex pIndex = new IndexClass();  
    IIndexEdit pIndexEdit = pIndex as IIndexEdit;  
    IFields pFields = new FieldsClass();  
    IFieldsEdit pFieldsEdit = pFields as IFieldsEdit;  
    int feildindex = pFeatureClass.Fields.FindField("Name");  
    IField pField = pFeatureClass.Fields.Field[feildindex];  
    pFieldsEdit.FieldCount_2 = 1;  
    pFieldsEdit.set_Field(0, pField);  
    pIndexEdit.Fields_2 = pFields;  
    pIndexEdit.Name_2 = zidField;  
    pIndexEdit.IsAscending_2 = true;  
    pFeatureClass.AddIndex(pIndex);  

 

相关文章:

  • 2022-12-23
  • 2021-06-29
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
  • 2021-05-12
  • 2021-06-19
  • 2021-07-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-13
  • 2021-10-01
  • 2021-06-25
  • 2022-12-23
相关资源
相似解决方案