A spatial database is a database that is optimized to store and query data that represents objects defined in a geometric space. Most spatial databases allow representing simple geometric objects such as points, lines and polygons. Some spatial databases handle more complex structures such as 3D objects, topological coverages, linear networks, and TINs. While typical databases are designed to manage various numeric and character types of data, additional functionality needs to be added for databases to process spatial data types efficiently. These are typically called geometry or feature. The Open Geospatial Consortium created the Simple Features specification and sets standards for adding spatial functionality to database systems.
Features of spatial databases
Database systems use indexes to quickly look up values and the way that most databases index data is not optimal for spatial queries. Instead, spatial databases use a spatial index to speed up database operations.
In addition to typical SQL queries such as SELECT statements, spatial databases can perform a wide variety of spatial operations. The following operations and many more are specified by the Open Geospatial Consortium standard:
- Spatial Measurements: Computes line length, polygon area, the distance between geometries, etc.
- Spatial Functions: Modify existing features to create new ones, for example by providing a buffer around them, intersecting features, etc.
- Spatial Predicates: Allows true/false queries about spatial relationships between geometries. Examples include "do two polygons overlap" or 'is there a residence located within a mile of the area we are planning to build the landfill?' (see DE-9IM)
- Geometry Constructors: Creates new geometries, usually by specifying the vertices (points or nodes) which define the shape.
- Observer Functions: Queries which return specific information about a feature such as the location of the center of a circle
Spatial indices are used by spatial databases (databases which store information related to objects in space) to optimize spatial queries. Conventional index types do not efficiently handle spatial queries such as how far two points differ, or whether points fall within a spatial area of interest. Common spatial index methods include:
- Grid (spatial index)
- Z-order (curve)
- R-tree: Typically the preferred method for indexing spatial data. Objects (shapes, lines and points) are grouped using the minimum bounding rectangle (MBR). Objects are added to an MBR within the index that will lead to the smallest increase in its size.
- R+ tree
- R* tree
- Hilbert R-tree
- m-tree - an m-tree index can be used for the efficient resolution of similarity queries on complex objects as compared using an arbitrary metric.
Spatial database systems
- All OpenGIS Specifications compliant products
- Open source spatial databases and APIs, some of which are OpenGIS compliant
- Boeing's Spatial Query Server spatially enables Sybase ASE.
- Smallworld VMDS, the native GE Smallworld GIS database
- SpatiaLite extends Sqlite with spatial datatypes, functions, and utilities.
- IBM DB2 Spatial Extender can be used to enable any edition of DB2, including the free DB2 Express-C, with support for spatial types
- Oracle Spatial
- Microsoft SQL Server has support for spatial types since version 2008
- PostgreSQL DBMS (database management system) uses the spatial extension PostGIS to implement the standardized datatype geometry and corresponding functions.
- Linter SQL Server supports spatial types and spatial functions according to the OpenGIS specifications.
- MySQL DBMS implements the datatype geometry plus some spatial functions that have been implemented according to the OpenGIS specifications. However, in MySQL version 5.5 and earlier, functions that test spatial relationships are limited to working with minimum bounding rectangles rather than the actual geometries. MySQL versions earlier than 5.0.16 only supported spatial data in MyISAM tables. As of MySQL 5.0.16, InnoDB, NDB, BDB, and ARCHIVE also support spatial features.
- Neo4j - Graph database that can build 1D and 2D indexes as Btree, Quadtree and Hilbert curve directly in the graph
- AllegroGraph - a Graph database provides a novel mechanism for efficient storage and retrieval of two-dimensional geospatial coordinates for Resource Description Framework data. It includes an extension syntax for SPARQL queries
- MongoDB and RavenDB support geospatial indexes in 2D
- Esri has a number of both single-user and multiuser geodatabases.
- SpaceBase is a real-time spatial database.
- CouchDB a document based database system that can be spatially enabled by a plugin called Geocouch
- CartoDB is a cloud based geospatial database on top of PostgreSQL with PostGIS.
- StormDB is an upcoming cloud based database on top of PostgreSQL with geospatial capabilities.
- SpatialDB by MineRP is the worlds first open standards (OGC) spatial database with spatial type extensions for the Mining Industry.
- Object-based spatial database
- Spatiotemporal database
- Spatial query
- Spatial analysis
- Location intelligence
- Spatial Databases: A Tour, Shashi Shekhar and Sanjay Chawla, Prentice Hall, 2003 (ISBN 0-13-017480-7)
- ESRI Press. ESRI Press titles include Modeling Our World: The ESRI Guide to Geodatabase Design, and Designing Geodatabases: Case Studies in GIS Data Modeling , 2005 Ben Franklin Award winner, PMA, The Independent Book Publishers Association.
- Spatial Databases - With Application to GIS Philippe Rigaux, Michel Scholl and Agnes Voisard. Morgan-Kauffman Publishers. 2002 (ISBN 1-55860-588-6)
- An introduction to PostgreSQL PostGIS
- PostgreSQL PostGIS as components in a Service Oriented Architecture SOA
- A Trigger Based Security Alarming Scheme for Moving Objects on Road Networks Sajimon Abraham, P. Sojan Lal, Published by Springer Berlin / Heidelberg-2008.