With the development of GIS, the volume of geospatial data has gradually increased, leading to reduced access speed for spatial data. Spatial indexes are data structures designed to improve the efficiency of spatial queries.
In geographic information systems, spatial indexes differ from field indexes. Field indexes are data structures provided by database systems or other computer systems for rapid key-value positioning. They enable fast access to data associated with specific keys, typically using B-trees or their variants. Due to the inherent spatial correlation of geospatial data, traditional field indexes cannot meet the rapid positioning requirements of spatial data, necessitating spatial indexes to provide location-aware data access capabilities.
SuperMap provides q-tree index, R-tree index, mapsheet index, dynamic index, and primary index support for specific databases. These indexes are applicable only to vector datasets.
The q-tree index employs an improved Hilbert coding scheme for spatial data, utilizing integrated storage of data and indexes. The R-tree index extends B-tree data structures to multidimensional spaces, offering high query efficiency with separate storage of index data and spatial data. Mapsheet index works exceptionally well for tiled data, such as national standard scale topographic maps organized by standard sheet divisions, making it suitable for building indexes based on sheet numbering. Dynamic index is a newly developed database engine optimization in SuperMap GIS that significantly enhances database query capabilities.
The primary index creates spatial indexes:
- In PostGIS, it uses GiST (Generalized Search Tree) index - a balanced tree-structured indexing method. Advantages: Accelerates spatial data retrieval. Disadvantages: Time-consuming to create and requires substantial storage space.
- In MongoDB, the 2dsphere index supports spherical geometry calculations and all MongoDB geospatial queries.
A dataset can only use one index type at a time, but indexes can be switched. When creating a new index for a dataset, the old index must be deleted first. The system automatically maintains current indexes during dataset editing. Notably, after multiple edits, index efficiency may be affected and require spatial index reconstruction.
Engine Type | R-tree Index | Q-tree Index | Dynamic Index | Mapsheet Index | Primary Index |
UDB | Y (Supports all) | N | N | N | N |
SQLPlus | Y (Excluding 2D/3D points and tabular datasets) | Y (Excluding 2D/3D points and tabular datasets) | Y (Excluding CAD datasets) | Y (Excluding route datasets) | N |
PostgreSQL | Y (Excluding 2D/3D points and tabular datasets) | N | N | Y (Excluding route datasets) | N |
OraclePlus | Y (Excluding 2D/3D points and tabular datasets) | Y (Excluding 2D/3D points and tabular datasets) | Y (Excluding CAD datasets) | Y (Excluding route datasets) | N |
OracleSpatial | Y (Supports all) | N | N | N | N |
KingBase | Y (Excluding 2D/3D points and tabular datasets) | Y (Excluding 2D/3D points and tabular datasets) | Y (Excluding CAD datasets) | Y (Excluding route datasets) | N |
MySQL | Y (Excluding 2D/3D points and tabular datasets) | Y (Excluding 2D/3D points and tabular datasets) | Y (Excluding CAD datasets) | Y (Excluding route datasets) | N |
BeyonDB | Y (Excluding 2D/3D points and tabular datasets) | N | N | N | N |
Altibase | Y (Excluding 2D/3D points and tabular datasets) | N | N | N | N |
PostGIS | N | N | N | N | Y (GiST Index) |
MongoDB | N | N | N | Y (Excluding route datasets) | Y (2dsphere Index) |