With the development of GIS, the amount of GIS data increases gradually, which makes the access speed of Spatial Data reduce. Spatial Index is a data structure used to improve the efficiency of Spatial Query.
Spatial Index in GIS is relative to Field Index. Field Index is a data structure that provides rapid location of keys in database systems or other computer systems. Field Index provides quick access to data for specific key values. Field Index generally uses a B-tree or a data structure derived from a B-tree. The traditional Field Index can not meet the needs of rapid positioning of Spatial Data because of the unique location correlation of Spatial Data, so it is necessary for Spatial Index to provide rapid access to location-related data.
SuperMap provides Q-tree Index, R-tree Index, Mapsheet Index, Dynamic Index, and Primary Index that supports partial databases, and these indexes are only applicable to Vector Dataset.
Quadtree uses improved Hilbert coding to encode Spatial Data, and uses the integrated storage mode of data and index. The data structure of R-tree index is the extension of B-tree in multi-dimensional space, and the index query is more efficient. The index data and Spatial Data are stored separately. Mapsheet Index has a good effect on the division data, for example, the data divided according to the standard map sheet in the national standard scale topographic map is suitable for establishing Mapsheet Index according to the map sheet number. Dynamic Index is a new index developed by SuperMap GIS for database engine, which greatly exerts the query ability of database.
Primary Index. Spatial Index is created.
- In PostGIS, it is GIST index, which means general search tree, and it is a balanced and tree-structured index method. Advantages: Accelerate the retrieval of Spatial Data. Disadvantages: It takes a long time to create and takes up a lot of space.
- In MongoDB, a 2D sphere is an index used to support queries for sphere geometry calculations. 2D sphere Index supports all MongoDB Geographic Spatial Queries.
A Dataset can only use one index at a time, but the index can be switched, that is, after an index is created for the Dataset, the old index must be deleted before a new one can be created. When a Dataset is in the editing state, the system automatically maintains the current index. In particular, when the data has been edited many times, the efficiency of the index will be affected to varying degrees, and the Spatial Index needs to be re-established.
Engine type | R-tree index | Q-tree Index | Dynamic Index | Mapsheet Index | Primary Index |
UDB | Y (All supported) | N | N | N | N |
SQLPlus | Y (excluding 2D, 3D points and Tabular Dataset) | Y (excluding 2D, 3D points and Tabular Dataset) | Y (excluding CAD Dataset) | Y (excluding Route Dataset) | N |
PostgreSQL | Y (excluding 2D, 3D points and Tabular Dataset) | N | N | Y (excluding Route Dataset) | N |
OraclePlus | Y (excluding 2D, 3D points and Tabular Dataset) | Y (excluding 2D, 3D points and Tabular Dataset) | Y (excluding CAD Dataset) | Y (excluding Route Dataset) | N |
OracleSpatial | Y (All supported) | N | N | N | N |
KingBase | Y (excluding 2D, 3D points and Tabular Dataset) | Y (excluding 2D, 3D points and Tabular Dataset) | Y (excluding CAD Dataset) | Y (excluding Route Dataset) | N |
MySQL | Y (excluding 2D, 3D points and Tabular Dataset) | Y (excluding 2D, 3D points and Tabular Dataset) | Y (excluding CAD Dataset) | Y (excluding Route Dataset) | N |
BeyonDB | Y (excluding 2D, 3D points and Tabular Dataset) | N | N | N | N |
Altibase | Y (excluding 2D, 3D points and Tabular Dataset) | N | N | N | N |
PostGIS | N | N | N | N | Y(GIST Index) |
MongoDB | N | N | N | Y (excluding Route Dataset) | Y(2dsphere Index) |