A spatial database is a general-purpose
database
In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases ...
(usually a
relational database
A relational database is a (most commonly digital) database based on the relational model of data, as proposed by E. F. Codd in 1970. A system used to maintain relational databases is a relational database management system (RDBMS). Many relati ...
) that has been enhanced to include
spatial data that represents objects defined in a
geometric space, along with tools for
querying and analyzing such data. Most spatial databases allow the representation of simple geometric objects such as
points
Point or points may refer to:
Places
* Point, Lewis, a peninsula in the Outer Hebrides, Scotland
* Point, Texas, a city in Rains County, Texas, United States
* Point, the NE tip and a ferry terminal of Lismore, Inner Hebrides, Scotland
* Points ...
,
lines and
polygon
In geometry, a polygon () is a plane figure that is described by a finite number of straight line segments connected to form a closed '' polygonal chain'' (or ''polygonal circuit''). The bounded plane region, the bounding circuit, or the two ...
s. Some spatial databases handle more complex structures such as
3D objects,
topological coverages, linear networks, and
triangulated irregular network
In computer graphics, a triangulated irregular network (TIN) is a representation of a continuous surface consisting entirely of triangular facets (a triangle mesh), used mainly as Discrete Global Grid in primary elevation modeling.
The ve ...
s (TINs). While typical databases have developed to manage various numeric and character
types of data, such databases require additional functionality to process spatial data types efficiently, and developers have often added ''geometry'' or ''feature'' data types. The
Open Geospatial Consortium
The Open Geospatial Consortium (OGC), an international voluntary consensus standards organization for geospatial content and location-based services, sensor web and Internet of Things, GIS data processing and data sharing. It originated in 199 ...
(OGC) developed the
Simple Features
Simple Features (officially Simple Feature Access) is a set of standards that specify a common storage and access model of geographic feature made of mostly two-dimensional geometries (point, line, polygon, multi-point, multi-line, etc.) used by g ...
specification (first released in 1997) and sets standards for adding spatial functionality to database systems. The ''
SQL/MM Spatial'' ISO/IEC standard is a part the SQL/MM multimedia standard and extends the Simple Features standard with data types that support circular interpolations.
[
]
Geodatabase
A geodatabase (also geographical database and geospatial database) is a
database
In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases ...
of
geographic data
Geographic data and information is defined in the ISO/TC 211 series of standards as data and information having an implicit or explicit association with a location relative to Earth (a geographic location or geographic position).
It is also cal ...
, such as
countries
A country is a distinct part of the world, such as a state (polity), state, nation, or other polity, political entity. It may be a sovereign state or make up one part of a larger state. For example, the country of Japan is an independent, so ...
,
administrative divisions
Administrative division, administrative unit,Article 3(1). country subdivision, administrative region, subnational entity, constituent state, as well as many similar terms, are generic names for geographical areas into which a particular, ind ...
,
cities
A city is a human settlement of notable size.Goodall, B. (1987) ''The Penguin Dictionary of Human Geography''. London: Penguin.Kuper, A. and Kuper, J., eds (1996) ''The Social Science Encyclopedia''. 2nd edition. London: Routledge. It can be def ...
, and related information. Such databases can be useful for websites that wish to
identify the locations of their visitors for customization purposes.
Characteristics
Database systems use indexes to quickly look up values; however, this way of indexing 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
The Open Geospatial Consortium (OGC), an international voluntary consensus standards organization for geospatial content and location-based services, sensor web and Internet of Things, GIS data processing and data sharing. It originated in 199 ...
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.
Some databases support only simplified or modified sets of these operations, especially in cases of
NoSQL
A NoSQL (originally referring to "non- SQL" or "non-relational") database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases. Such databases have existed ...
systems like
MongoDB
MongoDB is a source-available cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas. MongoDB is developed by MongoDB Inc. and licensed under the S ...
and
CouchDB
Apache CouchDB is an open-source document-oriented NoSQL database, implemented in Erlang.
CouchDB uses multiple formats and protocols to store, transfer, and process its data. It uses JSON to store data, JavaScript as its query language using ...
.
Spatial index
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:
*
Binary space partitioning (BSP-Tree): Subdividing space by hyperplanes.
*
Bounding volume hierarchy (BVH)
*
Geohash
Geohash is a public domain geocode system invented in 2008 by Gustavo NiemeyerEvidences at the Wayback Machine:
labix.org in 2008, the G. Niemeyer's blog announcing Geohash
*an article about Geohash witnessing and citing G. Niemeyer works, befor ...
*
Grid (spatial index)
In the context of a spatial index, a grid or mesh is a regular tessellation of a manifold or 2-D surface that divides it into a series of contiguous cells, which can then be assigned unique identifiers and used for spatial indexing purposes. A ...
*
HHCode
*
Hilbert R-tree
*
kd-tree
In computer science, a ''k''-d tree (short for ''k-dimensional tree'') is a space-partitioning data structure for organizing points in a ''k''-dimensional space. ''k''-d trees are a useful data structure for several applications, such as searc ...
*
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.
*
Octree
*
PH-tree
The PH-tree is a tree data structure used for spatial indexing of multi-dimensional data (keys) such as geographical coordinates, points, feature vectors, rectangles or bounding boxes.
The PH-tree is space partitioning index with a structur ...
*
Quadtree
*
R-tree
R-trees are tree data structures used for spatial access methods, i.e., for indexing multi-dimensional information such as geographical coordinates, rectangles or polygons. The R-tree was proposed by Antonin Guttman in 1984 and has found sig ...
: Typically the preferred method for indexing spatial data. Objects (shapes, lines and points) are grouped using the
minimum bounding rectangle
In computational geometry, the minimum bounding rectangle (MBR), also known as bounding box (BBOX) or envelope, is an expression of the maximum extents of a two-dimensional object (e.g. point, line, polygon) or set of objects within its coordin ...
(MBR). Objects are added to an MBR within the index that will lead to the smallest increase in its size.
*
R+ tree An R+ tree is a method for looking up data using a location, often (x, y) coordinates, and often for locations on the surface of the earth. Searching on one number is a solved problem; searching on two or more, and asking for locations that are nea ...
*
R* tree
*
UB-tree
*
X-tree
In computer science tree data structures, an X-tree (for ''eXtended node tree'') is an index tree structure based on the R-tree used for storing data in many dimensions. It appeared in 1996,
and differs from R-trees (1984), R+-trees (1987) a ...
*
Z-order (curve)
Spatial query
A spatial query is a special type of
database query supported by spatial databases, including geodatabases. The queries differ from non-spatial
SQL queries in several important ways. Two of the most important are that they allow for the use of geometry data types such as points, lines and polygons and that these queries consider the spatial relationship between these geometries.
The function names for queries differ across geodatabases. The following list contains commonly used functions built into
PostGIS
PostGIS ( ) is an open source software program that adds support for geographic objects to the PostgreSQL object-relational database. PostGIS follows the Simple Features for SQL specification from the Open Geospatial Consortium (OGC).
Technica ...
, a free geodatabase which is a PostgreSQL extension (the term 'geometry' refers to a point, line, box or other two or three dimensional shape):
Function prototype: ''functionName (parameter(s)) : return type ''
*Distance(geometry, geometry) : number
*Equals(geometry, geometry) : boolean
*Disjoint(geometry, geometry) : boolean
*Intersects(geometry, geometry) : boolean
*Touches(geometry, geometry) : boolean
*Crosses(geometry, geometry) : boolean
*Overlaps(geometry, geometry) : boolean
*Contains(geometry, geometry) : boolean
*Length(geometry) : number
*Area(geometry) : number
*
Centroid
In mathematics and physics, the centroid, also known as geometric center or center of figure, of a plane figure or solid figure is the arithmetic mean position of all the points in the surface of the figure. The same definition extends to any ...
(geometry) : geometry
Spatial database management systems
List
*
AllegroGraph
AllegroGraph is a closed source triplestore which is designed to store RDF triples, a standard format for Linked Data.
It also operates as a document store designed for storing, retrieving and managing document-oriented information, in JSON-LD ...
– a
graph database
A graph database (GDB) is a database that uses graph structures for semantic queries with nodes, edges, and properties to represent and store data. A key concept of the system is the '' graph'' (or ''edge'' or ''relationship''). The graph rel ...
which provides a mechanism for efficient storage and retrieval of two-dimensional geospatial coordinates for
Resource Description Framework The Resource Description Framework (RDF) is a World Wide Web Consortium (W3C) standard originally designed as a data model for metadata. It has come to be used as a general method for description and exchange of graph data. RDF provides a variety of ...
data. It includes an extension syntax for
SPARQL
SPARQL (pronounced " sparkle" , a recursive acronym for SPARQL Protocol and RDF Query Language) is an RDF query language—that is, a semantic query language for databases—able to retrieve and manipulate data stored in Resource Description ...
queries.
*
ArangoDB
ArangoDB is a free and open-source native graph database system developed by ArangoDB Inc. ArangoDB is a multi-model database system since it supports three data models (graphs, JSON documents, key/value) with one database core and a unified q ...
- a multi-model database which provides geoindexing capability.
*
Apache Drill
Apache Drill is an open-source software framework that supports data-intensive distributed applications for interactive analysis of large-scale datasets. Built chiefly by contributions from developers from MapR, Drill is inspired by Google's D ...
- A MPP SQL query engine for querying large datasets. Drill supports spatial data types and functions similar to PostgreSQL.
*
Caliper
A caliper (British spelling also calliper, or in plurale tantum sense a pair of calipers) is a device used to measure the dimensions of an object.
Many types of calipers permit reading out a measurement on a ruled scale, a dial, or a digital d ...
extends the
Raima
Raima is a multinational technology company headquartered in Seattle, USA. The company was founded in 1982. Raima develops, sells and supports in-memory and disk-based Relational Database Management Systems that can either be embedded within the a ...
Data Manager with spatial datatypes, functions, and utilities.
*
CouchDB
Apache CouchDB is an open-source document-oriented NoSQL database, implemented in Erlang.
CouchDB uses multiple formats and protocols to store, transfer, and process its data. It uses JSON to store data, JavaScript as its query language using ...
a document-based database system that can be spatially enabled by a plugin called Geocouch
*
Elasticsearch
Elasticsearch is a search engine based on the Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents. Elasticsearch is developed in Java and is dual ...
is a document-based database system that supports two types of geo data: geo_point fields which support lat/lon pairs, and geo_shape fields, which support points, lines, circles, polygons, multi-polygons, etc.
*
GeoMesa is a cloud-based spatio-temporal database built on top of
Apache Accumulo and
Apache Hadoop (also supports
Apache HBase
HBase is an open-source non-relational distributed database modeled after Google's Bigtable and written in Java. It is developed as part of Apache Software Foundation's Apache Hadoop project and runs on top of HDFS (Hadoop Distributed File Sys ...
,
Google
Google LLC () is an American Multinational corporation, multinational technology company focusing on Search Engine, search engine technology, online advertising, cloud computing, software, computer software, quantum computing, e-commerce, ar ...
Bigtable
Bigtable is a fully managed wide-column and key-value NoSQL database service for large analytical and operational workloads as part of the Google Cloud portfolio.
History
Bigtable development began in 2004.. It is now used by a number of Googl ...
,
Apache Cassandra
Cassandra is a free and open-source, distributed, wide-column store, NoSQL database management system designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure. Cassand ...
, and
Apache Kafka). GeoMesa supports full OGC
Simple Features
Simple Features (officially Simple Feature Access) is a set of standards that specify a common storage and access model of geographic feature made of mostly two-dimensional geometries (point, line, polygon, multi-point, multi-line, etc.) used by g ...
and a GeoServer plugin.
*
H2 supports geometry types and spatial indices as of version 1.3.173 (2013-07-28). An extension called H2GIS available on Maven Central gives full OGC
Simple Features
Simple Features (officially Simple Feature Access) is a set of standards that specify a common storage and access model of geographic feature made of mostly two-dimensional geometries (point, line, polygon, multi-point, multi-line, etc.) used by g ...
support.
* Any edition of
IBM Db2 can be spatially-enabled to implement the OpenGIS spatial functionality with SQL spatial types and functions.
*
IBM Informix
IBM Informix is a product family within IBM's Information Management division that is centered on several relational database management system (RDBMS) offerings. The Informix products were originally developed by Informix Corporation, whose ...
Geodetic and Spatial datablade extensions auto-install on use and expand Informix's datatypes to include multiple standard coordinate systems and support for RTree indexes. Geodetic and Spatial data can also be incorporated with Informix's Timeseries data support for tracking objects in motion over time.
*
Linter SQL Server supports spatial types and spatial functions according to the OpenGIS specifications.
*
Microsoft SQL Server
Microsoft SQL Server is a relational database management system developed by Microsoft. As a database server, it is a software product with the primary function of storing and retrieving data as requested by other software applications—which ...
has support for spatial types since version 2008
*
MonetDB/GIS extension for
MonetDB
MonetDB is an open-source column-oriented relational database management system (RDBMS) originally developed at the Centrum Wiskunde & Informatica (CWI) in the Netherlands.
It is designed to provide high performance on complex queries against l ...
adds OGS Simple Features to the relational
column-store database.
*
MySQL
MySQL () is an open-source relational database management system (RDBMS). Its name is a combination of "My", the name of co-founder Michael Widenius's daughter My, and "SQL", the acronym for Structured Query Language. A relational database ...
DBMS implements the datatype ''geometry'', plus some spatial functions 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
Neo4j is a graph database management system developed by Neo4j, Inc. Described by its developers as an ACID-compliant transactional database with native graph storage and processing, Neo4j is available in a non-open-source "community edition" ...
– a
graph database
A graph database (GDB) is a database that uses graph structures for semantic queries with nodes, edges, and properties to represent and store data. A key concept of the system is the '' graph'' (or ''edge'' or ''relationship''). The graph rel ...
that can build 1D and 2D indexes as
B-tree
In computer science, a B-tree is a self-balancing tree data structure that maintains sorted data and allows searches, sequential access, insertions, and deletions in logarithmic time. The B-tree generalizes the binary search tree, allowing for ...
,
Quadtree and
Hilbert curve
The Hilbert curve (also known as the Hilbert space-filling curve) is a continuous fractal space-filling curve first described by the German mathematician David Hilbert in 1891, as a variant of the space-filling Peano curves discovered by Giuseppe ...
directly in the
graph
Graph may refer to:
Mathematics
*Graph (discrete mathematics), a structure made of vertices and edges
**Graph theory, the study of such graphs and their properties
*Graph (topology), a topological space resembling a graph in the sense of discre ...
*
OpenLink Virtuoso has supported SQL/MM since version 6.01.3126, with significant enhancements including
GeoSPARQL
GeoSPARQL is a standard for representation and querying of geospatial linked data for the Semantic Web from the Open Geospatial Consortium (OGC). The definition of a small ontology based on well-understood OGC standards is intended to provide a st ...
in Open Source Edition 7.2.6, and in Enterprise Edition 8.2.0
*
Oracle Spatial
Oracle Spatial and Graph, formerly Oracle Spatial, is a free option component of the Oracle Database. The spatial features in Oracle Spatial and Graph aid users in managing geographic and location-data in a native type within an Oracle database, po ...
*
PostgreSQL DBMS (database management system) uses the extension
PostGIS
PostGIS ( ) is an open source software program that adds support for geographic objects to the PostgreSQL object-relational database. PostGIS follows the Simple Features for SQL specification from the Open Geospatial Consortium (OGC).
Technica ...
to implement OGC-compliant spatial functionality, including standardized datatype ''geometry'' and corresponding functions.
*
Redis with the Geo API.
*
RethinkDB supports geospatial indexes in 2D.
*
SAP HANA
SAP HANA (HochleistungsANalyseAnwendung or High-performance ANalytic Application) is an in-memory, column-oriented, relational database management system developed and marketed by SAP SE. Its primary function as the software running a databa ...
supports geospatial with SPS08.
*
Smallworld
Smallworld is the brand name of a portfolio of GIS software provided by GE Digital, a division of General Electric. The software was originally created by the Smallworld company founded in Cambridge, England, in 1989 by Dick Newell and others ...
VMDS, the native GE
Smallworld
Smallworld is the brand name of a portfolio of GIS software provided by GE Digital, a division of General Electric. The software was originally created by the Smallworld company founded in Cambridge, England, in 1989 by Dick Newell and others ...
GIS database
*
Spatial Query Server from
Boeing
The Boeing Company () is an American multinational corporation that designs, manufactures, and sells airplanes, rotorcraft, rockets, satellites, telecommunications equipment, and missiles worldwide. The company also provides leasing and p ...
spatially enables Sybase ASE.
*
SpatiaLite
SpatiaLite is a spatial extension to SQLite, providing vector geodatabase functionality. It is similar to PostGIS, Oracle Spatial, and SQL Server with spatial extensions, although SQLite/SpatiaLite aren't based on client-server architecture: they ...
extends
Sqlite
SQLite (, ) is a database engine written in the C programming language. It is not a standalone app; rather, it is a library that software developers embed in their apps. As such, it belongs to the family of embedded databases. It is the m ...
with spatial datatypes, functions, and utilities.
*
Tarantool supports geospatial queries with RTREE index.
[ ]
*
Teradata Geospatial includes 2D spatial functionality (OGC-compliant) in its data warehouse system.
*
Vertica Place, the geo-spatial extension for
HP Vertica, adds OGC-compliant spatial features to the relational
column-store database.
Table of free systems especially for spatial data processing
See also
*
Geographic information system (GIS)
*
GeoSPARQL
GeoSPARQL is a standard for representation and querying of geospatial linked data for the Semantic Web from the Open Geospatial Consortium (OGC). The definition of a small ontology based on well-understood OGC standards is intended to provide a st ...
*
Glacio-geological databases
*
Location intelligence
*
Multimedia database
*
Nearest neighbor search
Nearest neighbor search (NNS), as a form of proximity search, is the optimization problem of finding the point in a given set that is closest (or most similar) to a given point. Closeness is typically expressed in terms of a dissimilarity function ...
*
Object-based spatial database
*
Simple Features
Simple Features (officially Simple Feature Access) is a set of standards that specify a common storage and access model of geographic feature made of mostly two-dimensional geometries (point, line, polygon, multi-point, multi-line, etc.) used by g ...
*
Spatial analysis
Spatial analysis or spatial statistics includes any of the formal techniques which studies entities using their topological, geometric, or geographic properties. Spatial analysis includes a variety of techniques, many still in their early deve ...
*
Spatial ETL
*
Spatiotemporal database
A spatiotemporal database is a database that manages both space and time information. Common examples include:
* Tracking of moving objects, which typically can occupy only a single position at a given time.
* A database of wireless communication n ...
References
Further reading
Spatial Databases: A Tour Shashi Shekhar and Sanjay Chawla, Prentice Hall, 2003 ()
Spatial Databases – With Application to GISPhilippe Rigaux, Michel Scholl and Agnes Voisard.
Morgan Kaufmann Publishers
Morgan Kaufmann Publishers is a Burlington, Massachusetts (San Francisco, California until 2008) based publisher specializing in computer science and engineering content.
Since 1984, Morgan Kaufmann has published content on information technology ...
. 2002 ()
Evaluation of Data Management Systems for Geospatial Big DataPouria Amirian, Anahid Basiri and Adam Winstanley. Springer. 2014 ()
External links
An introduction to PostgreSQL PostGIS SOAA Trigger Based Security Alarming Scheme for Moving Objects on Road NetworksSajimon Abraham, P. Sojan Lal, Published by Springer Berlin / Heidelberg-2008.
ArcGIS Resource Center description of a geodatabase
{{Authority control
Geometric algorithms