Aspatial database is a general-purposedatabase (usually arelational database) that has been enhanced to includespatial data that represents objects defined in ageometric space, along with tools forquerying and analyzing such data.
Most spatial databases allow the representation of simple geometric objects such aspoints,lines andpolygons. Some spatial databases handle more complex structures such as3D objects,topological coverages, linear networks, andtriangulated irregular networks (TINs). While typical databases have developed to manage various numeric and charactertypes of data, such databases require additional functionality to process spatial data types efficiently, and developers have often addedgeometry orfeature data types.
Geographic database (orgeodatabase) is ageoreferenced spatial database, used for storing and manipulatinggeographic data (or geodata, i.e., data associated with a location on Earth),[a] especially ingeographic 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.
TheOpen Geospatial Consortium (OGC) developed theSimple Features specification (first released in 1997)[1] and sets standards for adding spatial functionality to database systems.[2] TheSQL/MM Spatial ISO/IEC standard is a part of the structured query language and multimedia standard extending the Simple Features.[3]
The core functionality added by a spatial extension to a database is one or morespatial datatypes, which allow for the storage of spatial data as attribute values in a table.[4] Most commonly, a single spatial value would be ageometric primitive (point, line, polygon, etc.) based on thevector data model. The datatypes in most spatial databases are based on the OGCSimple Features specification for representing geometric primitives. Some spatial databases also support the storage ofraster data. Because all geographic locations must be specified according to aspatial 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 theOpen Geospatial Consortium standard:
Some databases support only simplified or modified sets of these operations, especially in cases ofNoSQL systems likeMongoDB andCouchDB.
Aspatial index is used by a spatial database to optimizespatial queries, implementing spatial access methods. 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 forspatial queries in two- or three-dimensional space. Instead, spatial databases use aspatial index designed specifically for multi-dimensional ordering.[5] Common spatial index methods include:
Aspatial query is a special type ofdatabase query supported by spatial databases, including geodatabases. The queries differ from non-spatialSQL 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 intoPostGIS, 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) : numberST_Equals(geometry, geometry) : booleanST_Disjoint(geometry, geometry) : booleanST_Intersects(geometry, geometry) : booleanST_Touches(geometry, geometry) : booleanST_Crosses(geometry, geometry) : booleanST_Overlaps(geometry, geometry) : booleanST_Contains(geometry, geometry) : booleanST_Length(geometry) : numberST_Area(geometry) : numberST_Centroid(geometry) : geometryST_Intersection(geometry, geometry) : geometryThus, aspatial join between a points layer of cities and a polygon layer of countries could be performed in a spatially-extended SQL statement as:
SELECT*FROMcities,countriesWHEREST_Contains(countries.shape,cities.shape)
The Intersectvector overlay operation (a core element of GIS software) could be replicated as:
SELECTST_Intersection(veg.shape,soil.shape)int_poly,veg.*,soil.*FROMveg,soilwhereST_Intersects(veg.shape,soil.shape)
| DBS | License | Distributed | Spatial objects | Spatial functions | PostgreSQL interface | UMNMapServer interface | Documentation | Modifiable | HDFS |
|---|---|---|---|---|---|---|---|---|---|
| Apache Drill | Apache License 2.0 | Yes | Yes | Yes -Drill Geospatial Functions Documentation | Yes | No | OfficialDocumentation | ANSISQL | Yes |
| ArangoDB | Apache License 2.0 | Yes | Yes | Yes -capabilities overviewquery language functions | No | No | officialdocumentation | AQL | No |
| GeoMesa | Apache License 2.0 | Yes | Yes (Simple Features) | Yes (JTS) | No (manufacturable withGeoTools) | No | parts of the functions, a few examples | withSimple Feature Access inJava Virtual Machine andApache 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[24] | No | with MapScript | just briefly | with C and OME | No |
| Neo4J-spatial[25] | 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 ofJTS | No |
| PostgreSQL withPostGIS | GNU General Public License | No | Yes (Simple Features and raster) | Yes (Simple Feature Access and raster functions) | Yes | Yes | detailed | SQL, in connection withR | No |
| Postgres-XL withPostGIS | 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 withR orTcl orPython | No |
| Rasdaman | serverGPL, clientLGPL, enterprise proprietary | Yes | just raster | raster manipulation with rasql | Yes | withWeb Coverage Service orWeb Processing Service | detailed wiki | own defined function in enterprise edition | No |
| RethinkDB | AGPL | Yes | Yes |
| No | No | official documentation[26] | forking | No |
[...] 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.