VectorLayer.UseSpatialIndex

UseSpatialIndex(string, bool)

Loads spatial index to speed up filtering by attributes value in filter methods like WhereIntersects and NearestTo. If index does not exist creates it first. Use forceRebuild to force index recreation.

public void UseSpatialIndex(string indexPath, bool forceRebuild = false)
ParameterTypeDescription
indexPathStringPath to the index file.
forceRebuildBooleanWhether to recreate index even if it already exists.

Exceptions

exceptioncondition
ArgumentNullExceptionPath is null.
IOExceptionAn I/O error occurred.
InvalidOperationExceptionSpatial index is already loaded for this layer.
GisExceptionFile exists and it is not a spatial index file created by Aspose.GIS.

See Also


UseSpatialIndex(AbstractPath, bool)

Loads spatial index to speed up filtering by attributes value in filter methods like WhereIntersects and NearestTo. If index does not exist creates it first. Use forceRebuild to force index recreation.

public virtual void UseSpatialIndex(AbstractPath indexPath, bool forceRebuild = false)
ParameterTypeDescription
indexPathAbstractPathPath to the index file.
forceRebuildBooleanWhether to recreate index even if it already exists.

Exceptions

exceptioncondition
ArgumentNullExceptionPath is null.
IOExceptionAn I/O error occurred.
InvalidOperationExceptionSpatial index is already loaded for this layer.
GisExceptionFile exists and it is not a spatial index file created by Aspose.GIS.

See Also