The core functionality added by a spatial extension to a database is one or more spatial datatypes, which allow for the storage of spatial data as attribute values in a table.5 Most commonly, a single spatial value would be a geometric primitive (point, line, polygon, etc.) based on the vector data model. The datatypes in most spatial databases are based on the OGC Simple Features specification for representing geometric primitives. Some spatial databases also support the storage of raster data. Because all geographic locations must be specified according to a spatial reference system, spatial databases must also allow for the tracking and transformation of coordinate systems. In many systems, when a spatial column is defined in a table, it also includes a choice of coordinate system, chosen from a list of available systems that is stored in a lookup table.
The second major functionality extension in a spatial database is the addition of spatial capabilities to the query language (e.g., SQL); these give the spatial database the same query, analysis, and manipulation operations that are available in traditional GIS software. In most relational database management systems, this functionality is implemented as a set of new functions that can be used in SQL SELECT statements. Several types of operations are specified by the Open Geospatial Consortium standard:
Some databases support only simplified or modified sets of these operations, especially in cases of NoSQL systems like MongoDB and CouchDB.
A spatial index is used by a spatial database to optimize spatial queries. Database systems use indices to quickly look up values by sorting data values in a linear (e.g. alphabetical) order; however, this way of indexing data is not optimal for spatial queries in two- or three-dimensional space. Instead, spatial databases use a spatial index designed specifically for multi-dimensional ordering.6 Common spatial index methods include:
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 are a few of the functions built into PostGIS, a free geodatabase which is a PostgreSQL extension (the term 'geometry' refers to a point, line, box or other two or three dimensional shape):8
Function prototype: functionName (parameter(s)) : return type
Thus, a spatial join between a points layer of cities and a polygon layer of countries could be performed in a spatially-extended SQL statement as:
SELECT * FROM cities, countries WHERE ST_Contains(countries.shape, cities.shape)
The Intersect vector overlay operation (a core element of GIS software) could be replicated as:
SELECT ST_Intersection(veg.shape, soil.shape) int_poly, veg.*, soil.* FROM veg, soil where ST_Intersects(veg.shape, soil.shape)
Main category: Spatial database management systems
Main category: Geographical databases
The term "geodatabase" may also refer specifically to a set of proprietary spatial database formats, Geodatabase (Esri). /wiki/Geodatabase_(Esri) ↩
McKee, Lance (2016). "OGC History (detailed)". OGC. Retrieved 2016-07-12. [...] 1997 [...] OGC released the OpenGIS Simple Features Specification, which specifies the interface that enables diverse systems to communicate in terms of 'simple features' which are based on 2D geometry. The supported geometry types include points, lines, linestrings, curves, and polygons. Each geometric object is associated with a Spatial Reference System, which describes the coordinate space in which the geometric object is defined. http://www.opengeospatial.org/ogc/historylong ↩
OGC Homepage http://www.opengeospatial.org ↩
Kresse, Wolfgang; Danko, David M., eds. (2010). Springer handbook of geographic information (1. ed.). Berlin: Springer. pp. 82–83. ISBN 9783540726807. 9783540726807 ↩
Yue, P.; Tan, Z. "DM-03 - Relational DBMS and their Spatial Extensions". GIS&T Body of Knowledge. UCGIS. Retrieved 5 January 2023. https://gistbok.ucgis.org/bok-topics/relational-dbms-and-their-spatial-extensions ↩
Zhang, X.; Du, Z. "DM-66 Spatial Indexing". GIS&T Body of Knowledge. UCGIS. Retrieved 5 January 2023. http://gistbok.ucgis.org/bok-topics/spatial-indexing ↩
Güting, Ralf Hartmut; Schneider, Markus (2005). Moving Objects Databases. Morgan Kaufmann. p. 262. ISBN 9780120887996. 9780120887996 ↩
"PostGIS Function Reference". PostGIS Manual. OSGeo. Retrieved 4 January 2023. https://postgis.net/docs/reference.html ↩
[1] Drill Geospatial Function Documentation https://drill.apache.org/docs/gis-functions/ ↩
"Geo queries | Elasticsearch Guide [7.15] | Elastic". https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-queries.html ↩
H2 geometry type documentation http://www.h2database.com/html/datatypes.html#geometry_type ↩
H2 create spatial index documentation http://www.h2database.com/html/grammar.html#create_index ↩
"GeoSpatial – MonetDB". 4 March 2014. http://www.monetdb.org/Documentation/Extensions/GIS ↩
"MySQL 5.5 Reference Manual - 12.17.1. Introduction to MySQL Spatial Support". Archived from the original on 2013-04-30. Retrieved 2013-05-01. https://web.archive.org/web/20130430004440/http://dev.mysql.com/doc/refman/5.5/en/gis-introduction.html ↩
OpenLink Software. "9.34. Geometry Data Types and Spatial Index Support". Retrieved October 24, 2018. http://docs.openlinksw.com/virtuoso/sqlrefgeospatial/ ↩
OpenLink Software (2018-10-23). "New Releases of Virtuoso Enterprise and Open Source Editions". Retrieved October 24, 2018. https://medium.com/virtuoso-blog/new-releases-of-virtuoso-enterprise-and-open-source-editions-a3b39d2a076 ↩
"OGC Certified PostGIS". https://www.ogc.org/resource/products/details/?pid=1591 ↩
"Command reference – Redis". http://redis.io/commands/#geo ↩
"SAP Help Portal" (PDF). http://help.sap.com/hana/sap_hana_spatial_reference_en.pdf ↩
"RTREE". tarantool.org. Archived from the original on 2014-12-13. https://web.archive.org/web/20141213221030/http://tarantool.org/doc/user_guide/RTREE.html ↩
"HP Vertica Place". 2 December 2015. https://saas.hpe.com/marketplace/haven/hp-vertica-place-720 ↩
"GEOS". http://trac.osgeo.org/geos/ ↩
"Neo4j Spatial is a library of utilities for Neo4j that facilitates the enabling of spatial operations on data. In particular you can add spatial indexes to already located data, and perform spatial". GitHub. 2019-02-18. https://github.com/neo4j-contrib/spatial ↩
"ReQL command reference - RethinkDB". https://rethinkdb.com/api/javascript/ ↩