![]() ![]() sys.spatial_index_tessellations catalog view has NULL values for these columns when the auto grid options are used. The GEOMETRY_AUTO_GRID/ GEOGRAPHY_AUTO_GRID tessellation scheme options do not populate these columns. The grid densities of a spatial index are visible in the level_1_grid, level_2_grid, level_3_grid, and level_4_grid columns of the sys.spatial_index_tessellations catalog view when the database compatibility level is set to 100 or lower. For example, different grid densities on different levels might be useful for fine tuning an index based on the size of the indexed space and the objects in the spatial column. You can control the decomposition process by specifying non-default grid densities. (Auto grid indicates an 8 level configuration of HLLLLLLL.) Instead of varying index grid density, you can vary cells per object and query window cells per object via hint. When the database compatibility level is set to 110 or higher, then the default is an auto grid scheme. In SQL Server, when the database compatibility level is set to 100 or lower, then the default is MEDIUM on all levels. The grid density for a given level is specified by using one of the following keywords. The CREATE SPATIAL INDEXTransact-SQL statement supports a GRIDS clause that enables you to specify different grid densities at different levels. Grid density is defined on a per-level basis. For example, an 8x8 grid (which produces 64 cells), is denser than a 4x4 grid (which produces 16 cells). The number of cells along the axes of a grid determines its density: the larger the number, the denser the grid. The level-1 cells are numbered from 1 through 16, starting with the upper-left cell. In the following illustration, several polygons that represent buildings, and lines that represent streets, have already been placed into a 4x4, level-1 grid. For the purpose of illustration, however, this discussion uses a simple row-wise numbering, instead of the numbering that is actually produced by the Hilbert curve. Grid hierarchy cells are numbered in a linear fashion by using a variation of the Hilbert space-filling curve. The decomposition of space for a spatial index is independent of the unit of measurement that the application data uses. Thus, for example, decomposing a space into four levels of 4x4 grids actually produces a total of 65,536 level-four cells. In reality, all the cells are decomposed in this way. The following illustration shows the decomposition for the upper-right cell at each level of the grid hierarchy into a 4x4 grid. On a given level, all the grids have the same number of cells along both axes (for example, 4x4 or 8x8), and the cells are all one size. These levels are referred to as level 1 (the top level), level 2, level 3, and level 4.Įach successive level further decomposes the level above it, so each upper-level cell contains a complete grid at the next level. The index-creation process decomposes the space into a four-level grid hierarchy. Therefore, before reading data into a spatial index, SQL Server implements a hierarchical uniform decomposition of space. In SQL Server, spatial indexes are built using B-trees, which means that the indexes must represent the 2-dimensional spatial data in the linear order of B-trees. About Spatial Indexes Decomposing Indexed Space into a Grid Hierarchy See Microsoft/SQLServerSpatialTools in GitHub for more details. These functions may include data conversion routines, new transformations, aggregates, etc. This project provides a set of reusable functions which applications can make use of. SQL Server spatial tools is a Microsoft sponsored open-source collection of tools for use with the spatial types in SQL Server. ![]()
0 Comments
Leave a Reply. |