Spot db consistency checking and optimization in spatial database

Post on 11-May-2015

403 views 0 download

Tags:

description

SPOT databases: Spatial PrObablistic Temporal Databases

Transcript of Spot db consistency checking and optimization in spatial database

SPOT DATABASES: EFFICIENT CONSISTENCY CHECKING AND OPTIMISTIC SELECTION INPROBABILISTIC SPATIAL DATABASES

Presented By : Pratik S. Udapure

Agenda

Introduction Optimization Spatial Indexes Spatial Query SQL examples Features of Spatial Databases Advantages of Spatial Databases Disadvantages of Spatial Databases Conclusion

Introduction

Spatial database: is a database that is optimized to store and query data that represents objects defined in a geometric space

It offers additional functions that allow processing spatial data types. Geometry. Geography.

Introduction Cont.

Spatial Objects: Consists of lines, surfaces, volumes and higher dimension objects that are used in applications of computer-aided design, cartography, geographic information systems.

Spatial Data: The values of the objects spatial attributes (length, configuration, perimeter, area, volume, etc.)

Spatial DB Image

Optimization:

Optimizing spatial databases means optimizing the queries, which requires less time spent by running the queries before receiving an answer.

Spatial Indexes

Indexing Spatial Data: a mechanism to decrease the number of searches (optimize spatial queries).

A Spatial Index is used to locate objects in the same area of data or from different locations

Spatial indexes include: Grid index Z-order Octree Quadtree UB-tree R-tree kd-tree M-tree

Spatial Indexes: Grid Index

In the context of a Spatial Index, a grid (a.k.a. "mesh", also "global grid" if it covers the entire surface of the globe) is a regular division of a 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.

Spatial Indexes: Z-Order

In mathematical analysis and computer science, Z-order, Morton order, or Morton code is a function which maps multidimensional data to one dimension while preserving locality of the data points.

Spatial Indexes: Octree

An octree is a tree data structure in which each internal node has exactly eight childern. Octrees are most often used to partition a three dimensional space by recursively subdividing it into eight octants

Spatial Indexes: Quad Tree

A quadtree is a tree data structure in which each internal node has exactly four children. Quadtrees are most often used to partition a two-dimensional space by recursively subdividing it into four quadrants or regions.

Spatial Indexes: 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.

Spatial Indexes: R Tree

R-trees are tree data structure used for spatial access methods,i.e., for indexing multi-dimensional information such as geographical coordinates, rectangles or polygons.

Spatial Indexes: KD Tree

The k-d tree is a binary tree in which every node is a k-dimensional point. Every non-leaf node can be thought of as implicitly generating a splitting hyperlane that divides the space into two parts, known as half spaces.

Spatial Indexes: M Tree

M-trees are tree data structure that are similar to R-trees and B-trees. As in any Tree-based data structure, the M-Tree is composed of Nodes and Leaves. In each node there is a data object that identifies it uniquely and a pointer to a sub-tree where its children reside. Every leaf has several data objects

Spatial Query

A spatial query is a special type of database query supported by geo databases and spatial databases

Some 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.

SQL example

Create “pubs” table

create table pubs (name varchar,

beer-price float4);

addgeometrycolumn(‘beer-db’,'pubs','location’

,2167,'POINT',3);

Insert data

insert into pubs values ('Garricks Head',4.50,GeometryFromText('POINT (1196131 383324)’,2167));

Perform Query

select name, beer-price, distance(location, GeometryFromText('POINT(1195722 383854)',2167))

from pubs order by beer-price;

name | beer-price | distance ---------------+------------+------------------ Fireside | 4.25 | 1484.10275160491 The Forge | 4.33 | 1533.06561109862 Rumours | 4.46 | 2042.00094093097 Garricks Head | 4.5 | 669.389105609889 Slap Happy | 4.5 | 1882.31910168298 Old Bailys | 4.55 | 1147.20900404641 Black Sheep | 4.66 | 536.859935972633 Big Bad Daves | 4.75 | 907.446543878884

Features of spatial databases

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

Advantages of Spatial Databases

Able to treat your spatial data like anything else in the DB

transactions backups integrity checks less data redundancy fundamental organization and operations handled by the DB multi-user support security/access control locking

Advantages cont.

Spatial querying using SQL use simple SQL expressions to determine spatial relationships distance adjacency containment

use simple SQL expressions to perform spatial operations area length intersection union buffer

Disadvantages of Spatial Databases

Cost to implement can be high Some inflexibility Incompatibilities with some GIS software Slower than local, specialized data

structures User/managerial inexperience and caution

Conclusion

Spatial Databases are widely used nowadays.

Optimizing Spatial Databases is of a significant importance.

Spatial databases can be optimized using spatial indexes like R-tree or Quadtree and other indexing structures.

Big career opportunities in Spatial DB sector in developing GIS software