public enum SpatialIndexType extends java.lang.Enum<SpatialIndexType>
Spatial index type enumeration
Spatial index is the data structure used to improve the data space query efficiency. In SuperMap, it provides the R tree index, quadtree index, map index, and multilevel grid index. The above indexes only apply to vector data sets.
A data set can only use one index at a moment, but the index can be switched, that is, after an index is created for the dataset, it is necessary to delete the old index to create a new one. When the data set is in editing mode, the system automatically maintains the current index. In particular, when the data is edited multiple times, the efficiency of the index will be affected in different degrees, and the system will determine whether to re-establish the spatial index.
SDB data source supports follows for indexes :The support for indexes of UDB data source is consistent with SDB.
Enum Constant and Description |
---|
MULTI_LEVEL_GRID
Multilevel grid index.
|
NONE
No index.
|
QTREE
Quadtree indexes.
|
RTREE
R-tree index.
|
TILE
Map index.
|
Modifier and Type | Method and Description |
---|---|
static SpatialIndexType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static SpatialIndexType[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared.
|
public static final SpatialIndexType MULTI_LEVEL_GRID
The management of data is organized by means of multi-layer grid. The basic method of grid index is to divide the dataset into equal or unequal grids according to certain rules, and to record the grid position of each geographic object. In GIS, regular grid is commonly used. When the user queries spatial, the grid of the user's query object is calculated first, and quickly query the selected geographic object by the network, which can optimize the operation of querying. As shown:
In the current version, defines the grid index as primary, secondary and tertiary, and each level has its own dividing rules, the grid of the first level of is minimum, the grids of the second and third level are correspondingly larger than the previous. When the multi-level grid index is established, according to the specific data and distribution, the grid size and the series of grid indexes are automatically given by the system, no set required.
sasaPros: Multi-level grid index is slightly faster, when the dataset is being browsed.
Note: This index type supports to dynamic simultaneous editing of data sets.
public static final SpatialIndexType NONE
public static final SpatialIndexType QTREE
The quadtree is an important hierarchical data set structure, which is mainly used to express the spatial hierarchical relations of 2D coordinates. In fact, it is that one-dimensional binary tree extends to 2D space. Then, the quadtree index is to divide a map into four equal parts, and then each of the squares are divided into four equal parts, subdivided by layer, until they can no longer be divided. Now, in SuperMap, the quadtree can be divided up to 13 layers. Based on the sorting rules encoded by Hilbert, which minimum range the index attribute value of each object instance in the index class belongs to can be determined in the quadtree. This improves the query efficiency. A simple example of a quadtree index is shown in the figure:
public static final SpatialIndexType RTREE
R-tree is a disk-based index structure, it is that B tree (one-dimensional) naturally extends in higher dimensional space, easy to systematically integrate with existing database, can support various types of spatial query processing operations, it has been widely used in practice, which is one of the most popular method of spatial index. R-tree spatial index method is to design some rectangular containing spatial objects, containing the target object with close space position within the rectangle, sets these rectangle as spatial indexes, it contains the pointer of contained spatial objects. For example, A contains D、E、F、G spatial objects, B contains H、I、J、K spatial objects, C contains L、M、N spatial objects. Examples of R-tree indexes are shown in the figure.
When searching space, firstly judges which rectangles are in the query window, and then further determines which targets are searched. This improves the speed of retrieval.
Note:
public static final SpatialIndexType TILE
According to a particular attribute field of a dataset or according to a given range in the SuperMap, classifies the spatial objects, through the index, manages the classified spatial objects, in order to improve the speed of query and retrieval. The following figure shows an example of map index based on a given range:
In particular, the map index can be cached locally (in binary form), which further increases the speed of query and retrieval. The map index is applicable to massive amount of data(i.e., data with more than one million objects).
public static SpatialIndexType[] values()
for (SpatialIndexType c : SpatialIndexType.values()) System.out.println(c);
public static SpatialIndexType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null