Shapefile spatial index

Functions

bool Shapefile.CreateSpatialIndex (string ShapefileName)
 Creates a new spatial index More...
 
bool Shapefile.get_CanUseSpatialIndex (Extents pArea)
 Gets the value which indicates whether spatial index will be used for displaying certain extents of the shapefile. More...
 
bool Shapefile.IsSpatialIndexValid ()
 Checks the validity of the spatial index. More...
 
bool Shapefile.RemoveSpatialIndex ()
 Removes spatial index associated with shapefile (.mwd and .mwx files). More...
 

Properties

bool Shapefile.HasSpatialIndex [get, set]
 Gets the value indicating whether spatial index exists for the shapefile. More...
 
double Shapefile.SpatialIndexMaxAreaPercent [get, set]
 Gets or sets the value which affects the usage of spatial index. More...
 
bool Shapefile.UseQTree [get, set]
 Gets or sets a value which indicates whether built-in quad-tree spatial index should be used for shapefile. More...
 
bool Shapefile.UseSpatialIndex [get, set]
 Gets or sets a value which indicates whether spatial index should be used while working with shapefile. More...
 

Detailed Description

Here is a list of properties and methods for managing of spatial index for a shapefile. This module is a part of the documentation of Shapefile class.

dot_inline_dotgraph_33.png

Graph description

Function Documentation

◆ CreateSpatialIndex()

bool Shapefile.CreateSpatialIndex ( string  ShapefileName)

Creates a new spatial index

Parameters
ShapefileNameThe name of shapefile to create spatial index for. Filename of the current shapefile should be passed usually (Shapefile.Filename).
Returns

◆ get_CanUseSpatialIndex()

bool Shapefile.get_CanUseSpatialIndex ( Extents  pArea)

Gets the value which indicates whether spatial index will be used for displaying certain extents of the shapefile.

See also
SpatialIndexMaxAreaPercent

◆ IsSpatialIndexValid()

bool Shapefile.IsSpatialIndexValid ( )

Checks the validity of the spatial index.

Returns
True if the index is valid and false on its absence or incompatibility.

◆ RemoveSpatialIndex()

bool Shapefile.RemoveSpatialIndex ( )

Removes spatial index associated with shapefile (.mwd and .mwx files).

Returns
True on success.
New API 4.9.3:
Added in version 4.9.3

Properties

◆ HasSpatialIndex

bool Shapefile.HasSpatialIndex
getset

Gets the value indicating whether spatial index exists for the shapefile.

The set part of property does nothing. Use Shapefile.CreateSpatialIndex instead to create a new index.

◆ SpatialIndexMaxAreaPercent

double Shapefile.SpatialIndexMaxAreaPercent
getset

Gets or sets the value which affects the usage of spatial index.

Spatial index won't be used while drawing a part of shapefile larger then specified percent. Spatial index ensures faster access to the shapes while a small portion of shapefile is being displayed. On the contrary when substantial part of shapefile is being displayed spatial index can decrease the performance. This property blocks the usage of spatial index when it is inefficient.

◆ UseQTree

bool Shapefile.UseQTree
getset

Gets or sets a value which indicates whether built-in quad-tree spatial index should be used for shapefile.

Quad is used in editing mode only. It has nothing to do with disk based spatial index which is used by methods like Shapefile.CreateSpatialIndex.

New API 4.8:
Added in version 4.8
Examples:
SelectBox.cs, and ToolTip.cs.

◆ UseSpatialIndex

bool Shapefile.UseSpatialIndex
getset

Gets or sets a value which indicates whether spatial index should be used while working with shapefile.