140 likes | 257 Views
Spatial Database. 2/5/2011 Reference – Ramakrishna Gerhke and Silbershatz. Spatial Data. Any data that occupies space in a spacial world is spatial data Types Point Data – characterized only by its location and has not boundary Region Data – characterized by a centre and a boundary.
E N D
Spatial Database 2/5/2011 Reference – Ramakrishna Gerhke and Silbershatz
Spatial Data • Any data that occupies space in a spacial world is spatial data • Types • Point Data – characterized only by its location and has not boundary • Region Data – characterized by a centre and a boundary
Spatial Applications • Image data – Medical images like MRI scans • either transformed to lesser dimensions using image tranformation functions like hough function • or used directly as colors of locations • Geographic Information Systems (GIS) • To store roads and rivers as lines and buildings or landscapes as polygons • CAD/CAM Application • To store surfaces of modeling objects using wire mesh polygons • Effective indexing and nearest neighbor querying for numerical data
Querying Capabilities • Nearest Neighbor Queries • Find the first five close restaurants to my house • E.g., find all hotels within 100 metres from my house • Spatial Range Queries • Find all roads passing through a given region in map • Find all houses contained in a specific locality marked in the map using boundaries • Spatial Join Queries • Find all medical shops which are within about 10metres radius from the nearest hospital.
Indexing Schemes • Spatial Curve Indexing • Z-Order Indexing • Hilbert Curve Indexing • Grid File Indexing • R Tree Indexing
Spatial Curve Filling • The spatial curve filling approach orders the data using an z-value computed from the actual data represented in a bitmap • The z- value is computed as follows • Calculate the bitmapped value of the data point in the given space • Interleave the bits from several dimensions and obtain a new binary value • The decimal equivalent of the re-arranged bits is called the z-value • The z-value is indexed using B+Tree • The z-value ordering captures the spatial closeness of the represented data well
Grid Indexing • Creating a grid directory the data stored in pages • Add the location of data to the grid cell entries Grid Directory Scale 1 More than one cell pointed to the same space Scale 2
R-Tree • Stores Region • Mostly answers range queries and join trees • It is an extension of B+Trees • Mark all regions in the space as a bounding rectangle • A bounding rectangle is the smallest rectangle that encloses an object A C B D E
R-Trees • Partition the rectangle boxes using split operation • Insert the boundaries in a B_Tree • If the page is full split a bounding box and create the new split up nodes A C B D E