Skip to main content icon/video/no-internet

A spatial index is a data structure that has been designed to help in retrieving stored spatial data more rapidly. Spatial databases and GIS rely on spatial indices in order to be able to answer questions about the data they store within a reasonable amount of time. An enormous range of different spatial indices have been proposed. No single spatial index is suitable for all situations; each index is designed to work with particular types of spatial data and exhibits particular properties, advantages, and disadvantages.

The fundamental objective of using any index is to trade space efficiency for speed. By increasing the space required for storing data, an index helps to increase the speed of data retrieval. Good indices can achieve dramatic increases in the speed of data retrieval at the cost of only marginal increases in the amount of data stored. For example, the index in a book provides a list of keywords along with the pages on which those words appear. Finding a particular keyword would be extremely laborious without an index but takes only a few seconds using an index.

Many types of data, such as the words in a book, are simple to index because they can be easily ordered (e.g., using dictionary or lexical ordering, aardvark comes before abacus, which comes before abalone, and so on). Spatial data always has at least two dimensions (i.e., x and y dimensions or eastings and northings) and as a result requires more complex index structures.

Quadtrees

The quadtree is one of the most important spatial indices. The left-hand side of Figure 1 shows a simple spatial data set, which might represent the area covered by a lake. The data set is structured in raster format (made up of a regular square grid of cells), with cells that contain lake filled in gray and those that contain dry land filled in white. A quadtree indexes this data by recursively subdividing the area covered by the raster into quarters. At each step, those cells that contain different types of information (i.e., contain some lake and some land) are further subdivided. The right-hand side of Figure 1 illustrates the series of steps required to create the quadtree for the lake data set. By the fourth step in Figure 1, all the cells contain only one type of information (lake or land), so the recursive decomposition process stops at Level 4.

The advantage of using the quadtree structure becomes clear when we try to query the stored information. For example, suppose an application needs to test whether the point X in Figure 1 is in the lake or not. Without a spatial index of some kind (be it a simple row ordering of cells or a more sophisticated index like a quadtree), it would be necessary to search through the entire list of cells in the raster to answer this question. Each cell would need to be checked in turn to determine whether the point X is contained within that cell. In the worst case in Figure 1, this would mean searching the entire 16 × 16 raster, checking a total of 256 cells.

...

  • Loading...
locked icon

Sign in to access this content

Get a 30 day FREE TRIAL

  • Watch videos from a variety of sources bringing classroom topics to life
  • Read modern, diverse business cases
  • Explore hundreds of books and reference titles

Sage Recommends

We found other relevant content for you on other Sage platforms.

Loading