Jump to content

Spatial database: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
TA90901 (talk | contribs)
m Minor change
 
(34 intermediate revisions by 20 users not shown)
Line 1: Line 1:
{{Short description|Database optimized for storing and querying data that represents objects defined in a geometric space}}
{{Short description|Database optimized for data representing objects in a geometric space}}
A '''spatial database''' is a [[database]] optimized for storing and querying data that represents objects defined in a geometric space. Most spatial databases allow the representation of 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 [[Triangulated irregular network|TINs]] (triangulated irregular network). While typical databases have developed to manage various numeric and character [[data type|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|Open Geospatial Consortium (OGC)]] developed the [[Simple Features]] specification (first released in 1997)<ref>
{{cite web
| url = http://www.opengeospatial.org/ogc/historylong
| title = OGC History (detailed)
| last1 = McKee
| first1 = Lance
| year = 2016
| publisher = OGC
| access-date = 2016-07-12
| quote = [...] 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.
}}
</ref> and sets standards for adding spatial functionality to database systems.<ref>
[http://www.opengeospatial.org OGC Homepage]
</ref> 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.<ref name="Kresse2012">
{{cite book|title=Springer handbook of geographic information|url=https://archive.org/details/springerhandbook00kres|url-access=limited|date=2010|publisher=Springer|isbn=9783540726807|editor-last=Kresse|editor-first=Wolfgang|edition=1.|location=Berlin|pages=[https://archive.org/details/springerhandbook00kres/page/n109 82]–83|editor-last2=Danko|editor-first2=David M.}}
</ref>


A '''spatial database''' is a general-purpose [[database]] (usually a [[relational database]]) that has been enhanced to include [[spatial data]] that represents objects defined in a [[Space|geometric space]], along with tools for [[Information retrieval|querying]] and analyzing such data.
== Geodatabase ==
{{main cat|Geographical databases}}
{{Further|Map database management}}


Most spatial databases allow the representation of simple geometric objects such as [[Point (geometry)|points]], [[Line (geometry)|lines]] and [[polygon]]s. Some spatial databases handle more complex structures such as [[Solid geometry|3D objects]], [[Coverage data|topological coverages]], linear networks, and [[triangulated irregular network]]s (TINs). While typical databases have developed to manage various numeric and character [[data type|types of data]], such databases require additional functionality to process spatial data types efficiently, and developers have often added ''geometry'' or ''feature'' data types.
A '''geodatabase''' (also '''geographical database''' and '''geospatial database''') is a [[database]] of [[geographic data]], such as [[countries]], [[administrative divisions]], [[cities]], and related information. Such databases can be useful for websites that wish to identify the locations of their visitors for customization purposes.

'''Geographic database''' (or '''geodatabase''') is a [[georeferenced]] spatial database, used for storing and manipulating [[geographic data]] (or geodata, i.e., data associated with a location on Earth),{{efn|The term "geodatabase" may also refer specifically to a set of proprietary spatial database formats, [[Geodatabase (Esri)]].}} especially in [[geographic information systems]] (GIS). Almost all current relational and object-relational database management systems now have spatial extensions, and some GIS software vendors have developed their own spatial extensions to database management systems.

The [[Open Geospatial Consortium]] (OGC) developed the ''[[Simple Features]]'' specification (first released in 1997)<ref>{{cite web | url = http://www.opengeospatial.org/ogc/historylong | title = OGC History (detailed) | last1 = McKee | first1 = Lance | year = 2016 | publisher = OGC | access-date = 2016-07-12 | quote = [...] 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.}}</ref> and sets standards for adding spatial functionality to database systems.<ref>
[http://www.opengeospatial.org OGC Homepage]</ref> The ''SQL/MM Spatial'' ISO/IEC standard is a part of the structured query language and multimedia standard extending the Simple Features.<ref name="Kresse2012">{{cite book|title=Springer handbook of geographic information|url=https://archive.org/details/springerhandbook00kres|url-access=limited|date=2010|publisher=Springer|isbn=9783540726807|editor-last=Kresse|editor-first=Wolfgang|edition=1.|location=Berlin|pages=[https://archive.org/details/springerhandbook00kres/page/n109 82]–83|editor-last2=Danko|editor-first2=David M.}}
</ref>


==Characteristics==
==Characteristics==
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.<ref name="GISTBOK">{{cite web |last1=Yue |first1=P. |last2=Tan |first2=Z. |title=DM-03 - Relational DBMS and their Spatial Extensions |url=https://gistbok.ucgis.org/bok-topics/relational-dbms-and-their-spatial-extensions |website=GIS&T Body of Knowledge |publisher=UCGIS |access-date=5 January 2023}}</ref> Most commonly, a single spatial value would be a [[geometric primitive]] (point, line, polygon, etc.) based on the [[Data model (GIS)#Vector data model|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 graphics|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.
Database systems use indexes to quickly look up values; however, this way of indexing data is not optimal for [[spatial query|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:
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 [[Spatial analysis | 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:


*Spatial Measurements: Computes line length, polygon area, the distance between geometries, etc.
*Measurement: 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.
*Geoprocessing: Modify existing features to create new ones, for example by creating 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]])
*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.
*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
*Observer Functions: Queries that 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]] systems like [[MongoDB]] and [[CouchDB]].
Some databases support only simplified or modified sets of these operations, especially in cases of [[NoSQL]] systems like [[MongoDB]] and [[CouchDB]].


==Spatial index==
==Spatial index==
'''Spatial indices''' are used by spatial databases (databases which store information related to objects in space) to optimize [[spatial query|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:
A '''spatial index''' is used by a spatial database to optimize [[spatial query|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 query|spatial queries]] in two- or three-dimensional space. Instead, spatial databases use a ''spatial'' index designed specifically for multi-dimensional ordering.<ref name="GISTBOK_indexing">{{cite web |last1=Zhang |first1=X. |last2=Du |first2=Z. |title=DM-66 Spatial Indexing |url=http://gistbok.ucgis.org/bok-topics/spatial-indexing |website=GIS&T Body of Knowledge |publisher=UCGIS |access-date=5 January 2023}}</ref> Common spatial index methods include:


* [[Binary space partitioning]] (BSP-Tree): Subdividing space by hyperplanes.
*[[Geohash]]
* [[Bounding volume hierarchy]] (BVH)
*[[HHCode]]
*[[Grid (spatial index)]]
* [[Geohash]]
* [[Grid (spatial index)]]
*[[Z-order (curve)]]
* [[HHCode]]
*[[Quadtree]]
* [[Hilbert R-tree]]
* [[k-d tree|''k''-d tree]]
*[[Octree]]
* [[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.
*[[UB-tree]]
* [[Octree]]
*[[R-tree]]: Typically the preferred method for indexing spatial data.{{Citation needed|date=June 2012}} 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]]
* [[PH-tree]]
*[[R* tree]]
* [[Quadtree]]
* [[R-tree]]: Typically the preferred method for indexing spatial data.<ref>{{Cite book |last=Güting |first=Ralf Hartmut |title=Moving Objects Databases |last2=Schneider |first2=Markus |publisher=Morgan Kaufmann |year=2005 |isbn=9780120887996 |pages=262 |language=en}}</ref> 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.
*[[Hilbert R-tree]]
*[[X-tree]]
* [[R+ tree]]
*[[kd-tree]]
* [[R* tree]]
* [[UB-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.
* [[X-tree]]
*[[Binary space partitioning]] (BSP-Tree): Subdividing space by hyperplanes.
* [[Z-order (curve)]]


==Spatial query{{anchor|Query}}==
==Spatial query{{anchor|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.
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]], a free geodatabase which is a PostgreSQL extension (the term 'geometry' refers to a point, line, box or other two or three dimensional shape):
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):<ref>{{cite web |title=PostGIS Function Reference |url=https://postgis.net/docs/reference.html |website=PostGIS Manual |publisher=OSGeo |access-date=4 January 2023}}</ref>


Function prototype: ''functionName (parameter(s)) : return type ''
Function prototype: ''functionName (parameter(s)) : return type ''


*Distance(geometry, geometry) : number
* ST_Distance(geometry, geometry) : number
*Equals(geometry, geometry) : boolean
* ST_Equals(geometry, geometry) : boolean
*Disjoint(geometry, geometry) : boolean
* ST_Disjoint(geometry, geometry) : boolean
*Intersects(geometry, geometry) : boolean
* ST_Intersects(geometry, geometry) : boolean
*Touches(geometry, geometry) : boolean
* ST_Touches(geometry, geometry) : boolean
*Crosses(geometry, geometry) : boolean
* ST_Crosses(geometry, geometry) : boolean
*Overlaps(geometry, geometry) : boolean
* ST_Overlaps(geometry, geometry) : boolean
*Contains(geometry, geometry) : boolean
* ST_Contains(geometry, geometry) : boolean
*Length(geometry) : number
* ST_Length(geometry) : number
*Area(geometry) : number
* ST_Area(geometry) : number
*[[Centroid]](geometry) : geometry
* ST_[[Centroid]](geometry) : geometry
* ST_Intersection(geometry, geometry) : geometry

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:

<code>SELECT * FROM cities, countries WHERE ST_Contains(countries.shape, cities.shape)</code>

The Intersect [[vector overlay]] operation (a core element of GIS software) could be replicated as:

<code>SELECT ST_Intersection(veg.shape, soil.shape) int_poly, veg.*, soil.* FROM veg, soil where ST_Intersects(veg.shape, soil.shape)</code>


==Spatial database management systems==
==Spatial database management systems==
{{main category|Spatial database management systems}}
{{main category|Spatial database management systems}}
{{main cat|Geographical databases}}


===List===
===List===
<!--Entries in this list should be "notable" and already have a sourced Wikipedia article (see WP:GNG).-->
<!--Entries in this list should be "notable" and already have a sourced Wikipedia article (see WP:GNG).-->
* [[AllegroGraph]] – a [[graph database]] which provides a mechanism for efficient storage and retrieval of two-dimensional geospatial coordinates for [[Resource Description Framework]] data.{{citation needed|date=July 2016}} It includes an extension syntax for [[SPARQL]] queries.
* [[AllegroGraph]] – a [[graph database]] which provides a mechanism for efficient storage and retrieval of two-dimensional geospatial coordinates for [[Resource Description Framework]] data.{{citation needed|date=July 2016}} It includes an extension syntax for [[SPARQL]] queries.
*[[ArangoDB]] - a multi-model database which provides geoindexing capability.
* [[ArangoDB]] - a multi-model database which provides geoindexing capability.
* [[Apache Drill]] - A MPP SQL query engine for querying large datasets. Drill supports spatial data types and functions <ref>[https://drill.apache.org/docs/gis-functions/] Drill Geospatial Function Documentation</ref> similar to PostgreSQL.
* [[Caliper Corporation|Caliper]] extends the [[Raima]] Data Manager with spatial datatypes, functions, and utilities.
* Esri [[Geodatabase]] (Enterprise, Mobile) - a proprietary spatial database structure and logical model that can be implemented on several relational databases, both commercial (Oracle, MS SQL Server, Db2) and open source (PostgreSQL, SQLite)
* [[Caliper Corporation|Caliper]] extends the Raima Data Manager with spatial datatypes, functions, and utilities.
* [[CouchDB]] a document-based database system that can be spatially enabled by a plugin called Geocouch
* [[CouchDB]] a document-based database system that can be spatially enabled by a plugin called Geocouch
* [[Elasticsearch]] 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.<ref>https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-queries.html</ref>
* [[Elasticsearch]] 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.<ref>{{Cite web|url=https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-queries.html|title = Geo queries &#124; Elasticsearch Guide &#91;7.15&#93; &#124; Elastic}}</ref>
* [[GeoMesa]] is a cloud-based spatio-temporal database built on top of [[Apache Accumulo]] and [[Apache Hadoop]] (also supports [[Apache HBase]], [[Google]] [[Bigtable]], [[Apache Cassandra]], and [[Apache Kafka]]). GeoMesa supports full OGC [[Simple Features]] and a GeoServer plugin.
* [[GeoMesa]] is a cloud-based spatio-temporal database built on top of [[Apache Accumulo]] and [[Apache Hadoop]] (also supports [[Apache HBase]], [[Google]] [[Bigtable]], [[Apache Cassandra]], and [[Apache Kafka]]). GeoMesa supports full OGC [[Simple Features]] and a GeoServer plugin.
* [[H2 (DBMS)|H2]] supports geometry types<ref>[http://www.h2database.com/html/datatypes.html#geometry_type H2 geometry type documentation]</ref> and spatial indices<ref>[http://www.h2database.com/html/grammar.html#create_index H2 create spatial index documentation]</ref> as of version 1.3.173 (2013-07-28). An extension called H2GIS available on Maven Central gives full OGC [[Simple Features]] support.
* [[H2 (DBMS)|H2]] supports geometry types<ref>[http://www.h2database.com/html/datatypes.html#geometry_type H2 geometry type documentation]</ref> and spatial indices<ref>[http://www.h2database.com/html/grammar.html#create_index H2 create spatial index documentation]</ref> as of version 1.3.173 (2013-07-28). An extension called H2GIS available on Maven Central gives full OGC [[Simple Features]] support.
* Any edition of [[IBM DB2]] can be spatially-enabled to implement the OpenGIS spatial functionality with SQL spatial types and functions.
* Any edition of [[IBM Db2]] can be spatially-enabled to implement the OpenGIS spatial functionality with SQL spatial types and functions.
* [[IBM Informix]] 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.
* [[IBM Informix]] 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 RDBMS|Linter SQL Server]] supports spatial types and spatial functions according to the OpenGIS specifications.
* [[Linter SQL RDBMS|Linter SQL Server]] supports spatial types and spatial functions according to the OpenGIS specifications.
Line 96: Line 97:
* [[Virtuoso Universal Server|OpenLink Virtuoso]] has supported SQL/MM since version 6.01.3126,<ref>{{cite web |url=http://docs.openlinksw.com/virtuoso/sqlrefgeospatial/ |title=9.34. Geometry Data Types and Spatial Index Support |author=OpenLink Software |access-date= October 24, 2018}}</ref> with significant enhancements including [[GeoSPARQL]] in Open Source Edition 7.2.6, and in Enterprise Edition 8.2.0<ref>{{cite web |url=https://medium.com/virtuoso-blog/new-releases-of-virtuoso-enterprise-and-open-source-editions-a3b39d2a076 |title=New Releases of Virtuoso Enterprise and Open Source Editions |date=2018-10-23 |author=OpenLink Software |access-date= October 24, 2018}}</ref>
* [[Virtuoso Universal Server|OpenLink Virtuoso]] has supported SQL/MM since version 6.01.3126,<ref>{{cite web |url=http://docs.openlinksw.com/virtuoso/sqlrefgeospatial/ |title=9.34. Geometry Data Types and Spatial Index Support |author=OpenLink Software |access-date= October 24, 2018}}</ref> with significant enhancements including [[GeoSPARQL]] in Open Source Edition 7.2.6, and in Enterprise Edition 8.2.0<ref>{{cite web |url=https://medium.com/virtuoso-blog/new-releases-of-virtuoso-enterprise-and-open-source-editions-a3b39d2a076 |title=New Releases of Virtuoso Enterprise and Open Source Editions |date=2018-10-23 |author=OpenLink Software |access-date= October 24, 2018}}</ref>
* [[Oracle Spatial]]
* [[Oracle Spatial]]
* [[PostgreSQL]] DBMS (database management system) uses the spatial extension [[PostGIS]] to implement the standardized datatype ''geometry'' and corresponding functions.
* [[PostgreSQL]] DBMS (database management system) uses the extension [[PostGIS]] to implement OGC-compliant <ref>{{Cite web | url=https://www.ogc.org/resource/products/details/?pid=1591 | title=OGC Certified PostGIS}}</ref> spatial functionality, including standardized datatype ''geometry'' and corresponding functions.
* [[Redis]] with the Geo API.<ref>{{Cite web | url=http://redis.io/commands/#geo | title=Command reference – Redis}}</ref>
* [[Redis]] with the Geo API.<ref>{{Cite web | url=http://redis.io/commands/#geo | title=Command reference – Redis}}</ref>
* [[RethinkDB]] supports geospatial indexes in 2D.
* [[RethinkDB]] supports geospatial indexes in 2D.
* [[SAP HANA]] supports geospatial with SPS08.<ref>{{Cite web | url=http://help.sap.com/hana/sap_hana_spatial_reference_en.pdf | title=SAP Help Portal}}</ref>
* [[SAP HANA]] supports geospatial with SPS08.<ref>{{Cite web | url=http://help.sap.com/hana/sap_hana_spatial_reference_en.pdf | title=SAP Help Portal}}</ref>
* [[Smallworld]] [[VMDS]], the native GE [[Smallworld]] GIS database
* [[Smallworld]] [[VMDS]], the native GE [[Smallworld]] GIS database
* [https://www.mireo.com/spacetime SpaceTime] is a commercial spatiotemporal database built on top of the proprietary multidimensional index similar to the [[k-d tree|''k''-d tree]] family, but created using the bottom-up approach and adapted to particular space-time distribution of data.
* [[Spatial Query Server]] from [[Boeing]] spatially enables Sybase ASE.
* [[Spatial Query Server]] from [[Boeing]] spatially enables Sybase ASE.
* [[SpatiaLite]] extends [[Sqlite]] with spatial datatypes, functions, and utilities.
* [[SpatiaLite]] extends [[Sqlite]] with spatial datatypes, functions, and utilities.
* [[Tarantool]] supports geospatial queries with RTREE index.<ref>http://tarantool.org/doc/user_guide/RTREE.html#in-memory</ref>
* [[Tarantool]] supports geospatial queries with RTREE index.<ref>{{cite web |url=http://tarantool.org/doc/user_guide/RTREE.html#in-memory |title=RTREE |website=tarantool.org |url-status=dead |archive-url=https://web.archive.org/web/20141213221030/http://tarantool.org/doc/user_guide/RTREE.html |archive-date=2014-12-13}} </ref>
* [[Teradata Geospatial]] includes 2D spatial functionality (OGC-compliant) in its data warehouse system.
* [[Teradata Geospatial]] includes 2D spatial functionality (OGC-compliant) in its data warehouse system.
* [[Vertica|Vertica Place]], the geo-spatial extension for [[HP Information Management Software#HP Vertica|HP Vertica]], adds OGC-compliant spatial features to the relational [[column-oriented database|column-store]] database.<ref name="verticaplace">{{cite web | url = https://saas.hpe.com/marketplace/haven/hp-vertica-place-720 | title = HP Vertica Place | date = 2 December 2015}}</ref>
* [[Vertica|Vertica Place]], the geo-spatial extension for [[HP Information Management Software#HP Vertica|HP Vertica]], adds OGC-compliant spatial features to the relational [[column-oriented database|column-store]] database.<ref name="verticaplace">{{cite web | url = https://saas.hpe.com/marketplace/haven/hp-vertica-place-720 | title = HP Vertica Place | date = 2 December 2015}}</ref>
Line 112: Line 114:
! DBS !! License !! Distributed !! Spatial objects !! Spatial functions !! [[PostgreSQL]] interface !! UMN [[MapServer]] interface !! Documentation !! Modifiable !! [[HDFS]]
! DBS !! License !! Distributed !! Spatial objects !! Spatial functions !! [[PostgreSQL]] interface !! UMN [[MapServer]] interface !! Documentation !! Modifiable !! [[HDFS]]
|-
|-
|[[ArangoDB]]
| [[Apache Drill]]
|[[Apache License 2.0]]
| [[Apache License 2.0]]
|yes
| yes
|yes
| yes
| yes - [https://drill.apache.org/docs/gis-functions/ Drill Geospatial Functions Documentation]
|yes - [https://www.arangodb.com/community-server/geojson-support-geospatial-queries/ capabilities overview] [https://www.arangodb.com/docs/stable/aql/functions-geo.html query language functions]
| yes
|no
|no
| no
|official [https://www.arangodb.com/docs/stable/aql/functions-geo.html documentation]
| Official [https://drill.apache.org/docs/ Documentation]
| ANSI [[SQL]]
|AQL
| yes
|no
|-
| [[ArangoDB]]
| [[Apache License 2.0]]
| yes
| yes
| yes - [https://www.arangodb.com/community-server/geojson-support-geospatial-queries/ capabilities overview] [https://www.arangodb.com/docs/stable/aql/functions-geo.html query language functions]
| no
| no
| official [https://www.arangodb.com/docs/stable/aql/functions-geo.html documentation]
| AQL
| no
|-
|-
| style="text-align:left" |[[GeoMesa]]
| style="text-align:left" |[[GeoMesa]]
Line 138: Line 151:
| no
| no
| yes (custom, no raster)
| yes (custom, no raster)
|[[Simple Feature Access]] and custom functions for H2Network
| [[Simple Feature Access]] and custom functions for H2Network
| yes
| yes
| no
| no
Line 156: Line 169:
| no
| no
|-
|-
| style="text-align:left" |[[Neo4j|Neo4J]]-spatial<ref>{{Cite web | url=https://github.com/neo4j-contrib/spatial | title=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| date=2019-02-18}}</ref>
| style="text-align:left" |[[Neo4j|Neo4J]]-spatial<ref>{{Cite web | url=https://github.com/neo4j-contrib/spatial | title=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| website=[[GitHub]]| date=2019-02-18}}</ref>
| GNU affero general public license
| GNU affero general public license
| no
| no
Line 200: Line 213:
| no
| no
|-
|-
|[[RethinkDB]]
| [[RethinkDB]]
|[[Affero General Public License|AGPL]]
| [[Affero General Public License|AGPL]]
|yes
| yes
|yes
| yes
|
|
* distance
* distance
Line 210: Line 223:
* includes
* includes
* intersects
* intersects
|no
| no
|no
| no
|official documentation<ref>{{Cite web | url=https://rethinkdb.com/api/javascript/ | title=ReQL command reference - RethinkDB}}</ref>
| official documentation<ref>{{Cite web | url=https://rethinkdb.com/api/javascript/ | title=ReQL command reference - RethinkDB}}</ref>
|forking
| forking
|no
| no
|}
|}


Line 229: Line 242:
* [[Spatial ETL]]
* [[Spatial ETL]]
* [[Spatiotemporal database]]
* [[Spatiotemporal database]]

==Notes==
{{Notelist}}


==References==
==References==

Latest revision as of 06:47, 14 June 2024

A spatial database is a general-purpose database (usually a relational database) 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, lines and polygons. Some spatial databases handle more complex structures such as 3D objects, topological coverages, linear networks, and triangulated irregular networks (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.

Geographic database (or geodatabase) is a georeferenced spatial database, used for storing and manipulating geographic data (or geodata, i.e., data associated with a location on Earth),[a] especially in geographic information systems (GIS). Almost all current relational and object-relational database management systems now have spatial extensions, and some GIS software vendors have developed their own spatial extensions to database management systems.

The Open Geospatial Consortium (OGC) developed the Simple Features specification (first released in 1997)[1] and sets standards for adding spatial functionality to database systems.[2] The SQL/MM Spatial ISO/IEC standard is a part of the structured query language and multimedia standard extending the Simple Features.[3]

Characteristics

[edit]

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.[4] 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:

  • Measurement: Computes line length, polygon area, the distance between geometries, etc.
  • Geoprocessing: Modify existing features to create new ones, for example by creating a buffer around them, intersecting features, etc.
  • 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 that 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 systems like MongoDB and CouchDB.

Spatial index

[edit]

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.[5] Common spatial index methods include:

Spatial query

[edit]

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):[7]

Function prototype: functionName (parameter(s)) : return type

  • ST_Distance(geometry, geometry) : number
  • ST_Equals(geometry, geometry) : boolean
  • ST_Disjoint(geometry, geometry) : boolean
  • ST_Intersects(geometry, geometry) : boolean
  • ST_Touches(geometry, geometry) : boolean
  • ST_Crosses(geometry, geometry) : boolean
  • ST_Overlaps(geometry, geometry) : boolean
  • ST_Contains(geometry, geometry) : boolean
  • ST_Length(geometry) : number
  • ST_Area(geometry) : number
  • ST_Centroid(geometry) : geometry
  • ST_Intersection(geometry, geometry) : geometry

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)

Spatial database management systems

[edit]

List

[edit]
  • AllegroGraph – a graph database which provides a mechanism for efficient storage and retrieval of two-dimensional geospatial coordinates for Resource Description Framework data.[citation needed] It includes an extension syntax for SPARQL queries.
  • ArangoDB - a multi-model database which provides geoindexing capability.
  • Apache Drill - A MPP SQL query engine for querying large datasets. Drill supports spatial data types and functions [8] similar to PostgreSQL.
  • Esri Geodatabase (Enterprise, Mobile) - a proprietary spatial database structure and logical model that can be implemented on several relational databases, both commercial (Oracle, MS SQL Server, Db2) and open source (PostgreSQL, SQLite)
  • Caliper extends the Raima Data Manager with spatial datatypes, functions, and utilities.
  • CouchDB a document-based database system that can be spatially enabled by a plugin called Geocouch
  • Elasticsearch 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.[9]
  • GeoMesa is a cloud-based spatio-temporal database built on top of Apache Accumulo and Apache Hadoop (also supports Apache HBase, Google Bigtable, Apache Cassandra, and Apache Kafka). GeoMesa supports full OGC Simple Features and a GeoServer plugin.
  • H2 supports geometry types[10] and spatial indices[11] as of version 1.3.173 (2013-07-28). An extension called H2GIS available on Maven Central gives full OGC Simple Features support.
  • Any edition of IBM Db2 can be spatially-enabled to implement the OpenGIS spatial functionality with SQL spatial types and functions.
  • IBM Informix 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 has support for spatial types since version 2008
  • MonetDB/GIS extension for MonetDB adds OGS Simple Features to the relational column-store database.[12]
  • MySQL DBMS implements the datatype geometry, plus some spatial functions implemented according to the OpenGIS specifications.[13] 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 – a graph database that can build 1D and 2D indexes as B-tree, Quadtree and Hilbert curve directly in the graph
  • OpenLink Virtuoso has supported SQL/MM since version 6.01.3126,[14] with significant enhancements including GeoSPARQL in Open Source Edition 7.2.6, and in Enterprise Edition 8.2.0[15]
  • Oracle Spatial
  • PostgreSQL DBMS (database management system) uses the extension PostGIS to implement OGC-compliant [16] spatial functionality, including standardized datatype geometry and corresponding functions.
  • Redis with the Geo API.[17]
  • RethinkDB supports geospatial indexes in 2D.
  • SAP HANA supports geospatial with SPS08.[18]
  • Smallworld VMDS, the native GE Smallworld GIS database
  • SpaceTime is a commercial spatiotemporal database built on top of the proprietary multidimensional index similar to the k-d tree family, but created using the bottom-up approach and adapted to particular space-time distribution of data.
  • Spatial Query Server from Boeing spatially enables Sybase ASE.
  • SpatiaLite extends Sqlite with spatial datatypes, functions, and utilities.
  • Tarantool supports geospatial queries with RTREE index.[19]
  • 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.[20]

Table of free systems especially for spatial data processing

[edit]
DBS License Distributed Spatial objects Spatial functions PostgreSQL interface UMN MapServer interface Documentation Modifiable HDFS
Apache Drill Apache License 2.0 yes yes yes - Drill Geospatial Functions Documentation yes no Official Documentation ANSI SQL yes
ArangoDB Apache License 2.0 yes yes yes - capabilities overview query language functions no no official documentation AQL no
GeoMesa Apache License 2.0 yes yes (Simple Features) yes (JTS) no (manufacturable with GeoTools) no parts of the functions, a few examples with Simple Feature Access in Java Virtual Machine and Apache Spark are all kinds of tasks solvable yes
H2 (H2GIS) LGPL 3 (since v1.3), GPL 3 before no yes (custom, no raster) Simple Feature Access and custom functions for H2Network yes no yes (homepage) SQL no
Ingres GPL or proprietary yes (if extension is installed) yes (custom, no raster) Geometry Engine, Open Source[21] no with MapScript just briefly with C and OME no
Neo4J-spatial[22] GNU affero general public license no yes (Simple Features) yes (contain, cover, covered by, cross, disjoint, intersect, intersect window, overlap, touch, within and within distance) no no just briefly fork of JTS no
PostgreSQL with PostGIS GNU General Public License no yes (Simple Features and raster) yes (Simple Feature Access and raster functions) yes yes detailed SQL, in connection with R no
Postgres-XL with PostGIS Mozilla public license and GNU general public license yes yes (Simple Features and raster) yes (Simple Feature Access and raster functions) yes yes PostGIS: yes, Postgres-XL: briefly SQL, in connection with R or Tcl or Python no
Rasdaman server GPL, client LGPL, enterprise proprietary yes just raster raster manipulation with rasql yes with Web Coverage Service or Web Processing Service detailed wiki own defined function in enterprise edition no
RethinkDB AGPL yes yes
  • distance
  • getIntersecting
  • getNearest
  • includes
  • intersects
no no official documentation[23] forking no

See also

[edit]

Notes

[edit]
  1. ^ The term "geodatabase" may also refer specifically to a set of proprietary spatial database formats, Geodatabase (Esri).

References

[edit]
  1. ^ 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.
  2. ^ OGC Homepage
  3. ^ Kresse, Wolfgang; Danko, David M., eds. (2010). Springer handbook of geographic information (1. ed.). Berlin: Springer. pp. 82–83. ISBN 9783540726807.
  4. ^ Yue, P.; Tan, Z. "DM-03 - Relational DBMS and their Spatial Extensions". GIS&T Body of Knowledge. UCGIS. Retrieved 5 January 2023.
  5. ^ Zhang, X.; Du, Z. "DM-66 Spatial Indexing". GIS&T Body of Knowledge. UCGIS. Retrieved 5 January 2023.
  6. ^ Güting, Ralf Hartmut; Schneider, Markus (2005). Moving Objects Databases. Morgan Kaufmann. p. 262. ISBN 9780120887996.
  7. ^ "PostGIS Function Reference". PostGIS Manual. OSGeo. Retrieved 4 January 2023.
  8. ^ [1] Drill Geospatial Function Documentation
  9. ^ "Geo queries | Elasticsearch Guide [7.15] | Elastic".
  10. ^ H2 geometry type documentation
  11. ^ H2 create spatial index documentation
  12. ^ "GeoSpatial – MonetDB". 4 March 2014.
  13. ^ "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.
  14. ^ OpenLink Software. "9.34. Geometry Data Types and Spatial Index Support". Retrieved October 24, 2018.
  15. ^ OpenLink Software (2018-10-23). "New Releases of Virtuoso Enterprise and Open Source Editions". Retrieved October 24, 2018.
  16. ^ "OGC Certified PostGIS".
  17. ^ "Command reference – Redis".
  18. ^ "SAP Help Portal" (PDF).
  19. ^ "RTREE". tarantool.org. Archived from the original on 2014-12-13.
  20. ^ "HP Vertica Place". 2 December 2015.
  21. ^ "GEOS".
  22. ^ "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.
  23. ^ "ReQL command reference - RethinkDB".

Further reading

[edit]
[edit]