VectorLayer.UseAttributesIndex

UseAttributesIndex(string, string, bool)

加载属性索引以加快在诸如 WhereGreater 等过滤方法中按属性值进行过滤的速度。如果索引不存在,则先创建。使用 forceRebuild 强制重新创建索引。

public void UseAttributesIndex(string indexPath, string attributeName, bool forceRebuild = false)
参数类型描述
indexPath字符串索引文件的路径。
attributeName字符串用于构建索引的属性名称。
forceRebuildBoolean即使索引已存在,是否仍重新创建。

异常

异常条件
ArgumentNullException参数为 null
ArgumentException图层中不存在具有该名称的属性。
IOException发生了 I/O 错误。
InvalidOperationException指定属性的索引已为此图层加载。
GisException文件已存在,但它不是由 Aspose.GIS 创建的属性索引文件。

另见


UseAttributesIndex(AbstractPath, string, bool)

加载属性索引以加快在诸如 WhereGreater 等过滤方法中按属性值进行过滤的速度。如果索引不存在,则先创建。使用 forceRebuild 强制重新创建索引。

public virtual void UseAttributesIndex(AbstractPath indexPath, string attributeName, 
    bool forceRebuild = false)
参数类型描述
indexPathAbstractPath索引文件的路径。
attributeName字符串用于构建索引的属性名称。
forceRebuildBoolean即使索引已存在,是否仍重新创建。

异常

异常条件
ArgumentNullException参数为 null
ArgumentException图层中不存在具有该名称的属性。
IOException发生了 I/O 错误。
InvalidOperationException指定属性的索引已为此图层加载。
GisException文件已存在,但它不是由 Aspose.GIS 创建的属性索引文件。

另见