0% found this document useful (0 votes)
47 views16 pages

Spatial Database

Spatial databases are optimized for storing and querying geometric spatial data types. They allow representation of simple shapes like points, lines and polygons associated with geographic locations. Spatial databases offer spatial data types in their data model and support spatial indexing and efficient algorithms for spatial queries. Common spatial indexes used include geohash, quadtree and R-tree which partition space into hierarchical grid cells or regions to optimize spatial queries.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views16 pages

Spatial Database

Spatial databases are optimized for storing and querying geometric spatial data types. They allow representation of simple shapes like points, lines and polygons associated with geographic locations. Spatial databases offer spatial data types in their data model and support spatial indexing and efficient algorithms for spatial queries. Common spatial indexes used include geohash, quadtree and R-tree which partition space into hierarchical grid cells or regions to optimize spatial queries.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 16

Spatial Database:-

A spatial database is a database that is 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. Spatial data
is associated with geographic locations such as cities, towns etc.

Some spatial databases handle more complex structures such as


3D objects, topological coverages, linear networks, and TINs
(Triangulated Irregular Networks). While typical databases have
developed to manage various numeric and character types of
data but spatial databases require additional functionality to
process spatial data types efficiently and developers have often
added geometry feature data types. The Open Geospatial
Consortium developed the Simple features specification (first
released in 1997) and sets standards for adding spatial
functionality to database systems.

Characteristics of Spatial Database:-

A spatial database system has the following characteristics

1. It is a database system
2. It offers spatial data types (SDTs) in its data model and
query language.
3. It supports spatial data types in its implementation, providing
at least spatial indexing and efficient algorithms for spatial
join.
Example:-

A road map is a visualization of geographic information. A road


map is a 2-dimensional object which contains points, lines, and
polygons that can represent cities, roads, and political boundaries
such as states or provinces. 

In general, spatial data can be of two types:

1. Vector data: This data is represented as discrete points,


lines and polygons
2. Rastor data: This data is represented as a matrix of square
cells.

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?
 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 systems
like MongoDB and CouchDB.

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. Some of the common spatial
index methods includes:

 Geohash

Geohash is a public domain geocode system invented in 2008


by Gustavo Niemeyer, which encodes a geographic location
into a short string of letters and digits. It is a hierarchical spatial
data structure which subdivides space into buckets
of grid shape, which is one of the many applications of what is
known as a Z-order curve and generally space-filling curves.

Geohashes offer properties like arbitrary precision and the


possibility of gradually removing characters from the end of the
code to reduce its size (and gradually lose precision).
For example, the coordinate pair 28.6132,77.2291 (area
surrounding the India Gate in New Delhi) can be represented in
geohash as ttnfv2u.
Each extra character added to the Geohash adds precision to
the location represented by the Geohash.

To create a Geohash for our point (shown as a Red dot), let’s


first divide the world into two halves with a vertical line and give
each half a binary value of either 0 or 1.
Now, we can divide that half again along the Equator and add
the second bit. Then, repeat this subdivision, alternating
between longitude and latitude, until the remaining area is
within the desired precision.

At our desired precision, our Geohash will look like a long


binary string:
01010101101010101010101010111
Finally, we encode the resulting binary sequence as
alphanumeric characters (Base-32 alphabet encoding is used
where characters can be 0 to 9 and A to Z, excluding “A”, “I”,
“L” and “O”).
Each 5 bits is converted to one character that looks something
like ttnfv2u.

 HHCode

A Helical Hyperspatial Code is also known as HHCode, is a data


storage format for very large spatio-temporal datasets. The
HHCode indexing system permitted a highly efficient compression
of not only spatial data but other data types as well, while
improving search and retrieval times. The HHCode comprises a
form of space filling curve and the concept was published by the
CHS (Canadian Hydrographic Service) scientists in
the International Hydrographic Review.

 Grid (spatial index)

In the context of a spatial index, a grid or mesh is a regular 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 wide variety of such grids have been proposed are
currently in use that includes grids based on "square" or
"rectangular" cells, triangular grids or meshes.
In the following example, the feature class has two grid levels.
Area shape 101 is located in grid cell 4 on level 1. A record is
added to the spatial index table, because the feature resides
within four grid cells (in this case, it is one). The envelope for area
feature 102 is located in cells 1 through 8 on level 1. Because the
feature's envelope resides in more than four grid cells, the feature
is promoted to level 2, where its envelope fits within two grid cells.
Feature 102 is indexed at level 2, and two records are added to
the spatial index table.

The following depicts a fixed 4×4 gird indexing a collection of


three spatial objects.

 Z-order (curve)

The z-value of a point in multi-dimensions is simply calculated by


interleaving the binary representations of its coordinate values.
Once the data are sorted into this ordering, any one-dimensional
data structure can be used such as binary search trees, B-
trees, skip lists or (with low significant bits truncated) hash tables.
The resulting order can be equivalently described as the order
that would get from a depth-first traversal of a quadtree.

 Quadtree

A quadtree is a tree data structure in which each internal node


has exactly four children. Quadtrees are the two-dimensional
analog of octrees and are most often used to partition a two-
dimensional space by recursively subdividing it into four
quadrants or regions. The data associated with a leaf cell varies
by application, but the leaf cell represents a "unit of interesting
spatial information".

The subdivided regions may be square or rectangular, or may


have arbitrary shapes. This data structure was named as
quadtree by Raphael Finkel and J.L. Bentley in 1974. A similar
partitioning is also known as Q-tree. All forms of quadtrees share
some common features:

 They decompose space into adaptable cells.


 Each cell (or bucket) has a maximum capacity. When
maximum capacity is reached, the bucket splits.
 The tree directory follows the spatial decomposition of the
quadtree.
 Octree
An octree is a tree data structure in which each internal
node has exactly eight children. Octrees are most often used to
partition a three-dimensional space by recursively subdividing it
into eight octants. Octrees are the three-dimensional analog
of quadtrees. Octrees are often used in 3D graphics and
3D game engines.

 UB-tree

The UB-tree as proposed by Rudolf Bayer and Volker


Markl is a balanced tree for storing and efficiently
retrieving multidimensional data. It is basically a B+
tree (information only in the leaves) with records stored
according to Z-order, also called Morton order. Z-order is
simply calculated by bitwise interlacing the keys.

Insertion, deletion, and point query are done as with ordinary


B+ trees. To perform range searches in multidimensional
point data, however, an algorithm must be provided for
calculating from a point encountered in the data base to the
next Z-value which is in the multidimensional search range.

 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
significant use in both theoretical and applied contexts. A
common real-world usage for a R-tree might be to store spatial
objects such as restaurant locations or the polygons that typical
maps are made of: streets, buildings, outlines of lakes, coastlines,
etc. and then find answers quickly to queries such as "Find all
museums within 2 km of my current location", "retrieve all road
segments within 2 km of my location" (to display them in
a navigation system) or "find the nearest gas station" (although
not taking roads into account). The R-tree can also
accelerate nearest neighbor search for various distance metrics,
including great-circle distance.
Spatial database system
Some of the common spatial database system includes:

 AllegroGraph – a graph database which provides a


mechanism for efficient storage and retrieval of two-
dimensional geospatial coordinates for Resource Description
Framework data. It includes an extension syntax
for SPARQL queries.

 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
 Esri has a number of both single-user and multiuser
geodatabases.

Note:-

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.

 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 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 support.

 IBM DB2 Spatial Extender can spatially-enable any edition


of DB2, including the free DB2 Express-C with support for
spatial types.

 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

 Neo4j – a graph database that can build 1D and 2D indexes


as B-tree, Quadtree and Hilbert curve directly in the graph.

 PostgreSQL DBMS (database management system) uses


the spatial extension PostGIS to implement the standardized
datatype geometry and corresponding functions.

You might also like