Spatial Data Structures Hanan Samet Computer Science Department

Slides:



Advertisements
Similar presentations
Multidimensional Data Structures
Advertisements

The A-tree: An Index Structure for High-dimensional Spaces Using Relative Approximation Yasushi Sakurai (NTT Cyber Space Laboratories) Masatoshi Yoshikawa.
Nearest Neighbor Search
Spatial Indexing SAMs. Spatial Indexing Point Access Methods can index only points. What about regions? Z-ordering and quadtrees Use the transformation.
Spatial Join Queries. Spatial Queries Given a collection of geometric objects (points, lines, polygons,...) organize them on disk, to answer point queries.
 Definition of B+ tree  How to create B+ tree  How to search for record  How to delete and insert a data.
Efficient access to TIN Regular square grid TIN Efficient access to TIN Let q := (x, y) be a point. We want to estimate an elevation at a point q: 1. should.
Searching on Multi-Dimensional Data
1 abstract containers hierarchical (1 to many) graph (many to many) first ith last sequence/linear (1 to 1) set.
Image Indexing and Retrieval using Moment Invariants Imran Ahmad School of Computer Science University of Windsor – Canada.
Quadtrees Raster and vector.
Spatial Mining.
CS447/ Realistic Rendering -- Solids Modeling -- Introduction to 2D and 3D Computer Graphics.
2-dimensional indexing structure
Spatial indexing PAMs (II).
Spatial Indexing SAMs. Spatial Indexing Point Access Methods can index only points. What about regions? Z-ordering and quadtrees Use the transformation.
Spatial Information Systems (SIS) COMP Spatial access methods: Indexing.
Spatial Information Systems (SIS) COMP Raster-based structures (1)
Spatial Indexing I Point Access Methods. Spatial Indexing Point Access Methods (PAMs) vs Spatial Access Methods (SAMs) PAM: index only point data Hierarchical.
1 R-Trees for Spatial Indexing Yanlei Diao UMass Amherst Feb 27, 2007 Some Slide Content Courtesy of J.M. Hellerstein.
Chapter 3: Data Storage and Access Methods
Spatial Indexing I Point Access Methods.
1 abstract containers hierarchical (1 to many) graph (many to many) first ith last sequence/linear (1 to 1) set.
General Trees and Variants CPSC 335. General Trees and transformation to binary trees B-tree variants: B*, B+, prefix B+ 2-4, Horizontal-vertical, Red-black.
R-Trees 2-dimensional indexing structure. R-trees 2-dimensional version of the B-tree: B-tree of maximum degree 8; degree between 3 and 8 Internal nodes.
Spatial Indexing I Point Access Methods. Spatial Indexing Point Access Methods (PAMs) vs Spatial Access Methods (SAMs) PAM: index only point data Hierarchical.
Spatial Information Systems (SIS) COMP Spatial access methods: Indexing (part 2)
Spatial Indexing I Point Access Methods. Spatial Indexing Point Access Methods (PAMs) vs Spatial Access Methods (SAMs) PAM: index only point data Hierarchical.
R-TREES: A Dynamic Index Structure for Spatial Searching by A. Guttman, SIGMOD Shahram Ghandeharizadeh Computer Science Department University of.
Binary Trees Chapter 6.
Chapter 61 Chapter 6 Index Structures for Files. Chapter 62 Indexes Indexes are additional auxiliary access structures with typically provide either faster.
Trees for spatial indexing
Data Structures for Computer Graphics Point Based Representations and Data Structures Lectured by Vlastimil Havran.
B+ Trees COMP
Spatial Data Management Chapter 28. Types of Spatial Data Point Data –Points in a multidimensional space E.g., Raster data such as satellite imagery,
The X-Tree An Index Structure for High Dimensional Data Stefan Berchtold, Daniel A Keim, Hans Peter Kriegel Institute of Computer Science Munich, Germany.
Lecture 10 Trees –Definiton of trees –Uses of trees –Operations on a tree.
Chapter 6 Binary Trees. 6.1 Trees, Binary Trees, and Binary Search Trees Linked lists usually are more flexible than arrays, but it is difficult to use.
© 2006 Pearson Addison-Wesley. All rights reserved13 B-1 Chapter 13 (continued) Advanced Implementation of Tables.
Mehdi Mohammadi March Western Michigan University Department of Computer Science CS Advanced Data Structure.
Multi-dimensional Search Trees
PRESENTED BY – GAURANGI TILAK SHASHANK AGARWAL Collision Detection.
R-Tree. 2 Spatial Database (Ia) Consider: Given a city map, ‘index’ all university buildings in an efficient structure for quick topological search.
Nearest Neighbor Queries Chris Buzzerd, Dave Boerner, and Kevin Stewart.
Bin Yao (Slides made available by Feifei Li) R-tree: Indexing Structure for Data in Multi- dimensional Space.
Spatial Indexing Techniques Introduction to Spatial Computing CSE 5ISC Some slides adapted from Spatial Databases: A Tour by Shashi Shekhar Prentice Hall.
Spatial and Geographic Databases. Spatial databases store information related to spatial locations, and support efficient storage, indexing and querying.
Spatial Indexing Techniques Introduction to Spatial Computing CSE 5ISC Some slides adapted from Spatial Databases: A Tour by Shashi Shekhar Prentice Hall.
R-Trees: A Dynamic Index Structure For Spatial Searching Antonin Guttman.
1 CSIS 7101: CSIS 7101: Spatial Data (Part 1) The R*-tree : An Efficient and Robust Access Method for Points and Rectangles Rollo Chan Chu Chung Man Mak.
1 Overview (Part 1) Background notions A reference framework for multiresolution meshes Classification of multiresolution meshes An introduction to LOD.
Multidimensional Access Structures COMP3017 Advanced Databases Dr Nicholas Gibbins –
DATA STRUCURES II CSC QUIZ 1. What is Data Structure ? 2. Mention the classifications of data structure giving example of each. 3. Briefly explain.
1 R-Trees Guttman. 2 Introduction Range queries in multiple dimensions: Computer Aided Design (CAD) Geo-data applications Support special data objects.
Indexing Multidimensional Data
Spatial Data Management
Trees Chapter 15.
Data Structures: Disjoint Sets, Segment Trees, Fenwick Trees
Multiway Search Trees Data may not fit into main memory
Multidimensional Access Structures
COMP 9517 Computer Vision Segmentation 7/2/2018 COMP 9517 S2, 2017.
Spatial Indexing I Point Access Methods.
B+ Tree.
Mean Shift Segmentation
CSE373: Data Structures & Algorithms Lecture 23: Applications
Graphs Chapter 11 Objectives Upon completion you will be able to:
Spatial Indexing I R-trees
File Processing : Multi-dimensional Index
Multidimensional Search Structures
Presentation transcript:

Spatial Data Structures Hanan Samet Computer Science Department Snehal Thakkar Spatial Data Structures Hanan Samet Computer Science Department University of Maryland Snehal Thakkar

Spatial Data Structures Introduction Spatial Indexing Region Data Point Data Rectangle Data Line Data Conclusion Snehal Thakkar

Introduction Spatial Objects Points, Lines, Regions, Rectangles ….. Spatial Indexing Unlike conventional data sort has to be on space occupied by data Hierarchical Data Structures Based on recursive decomposition, similar to divide and conquer method Snehal Thakkar

Spatial Indexing Mapping Spatial Data into Point Bucketing Methods - Same, Higher or Lower Dimension - Good storage purposes, queries like intersect - Problems with queries like nearest Bucketing Methods - Grid file, BANG file, LSD trees, Buddy trees…. - Buckets based on not the representative point, but based on actual space. Snehal Thakkar

R-tree Based on Minimum Bounding Rectangle R2 R3 R4 R5 R6 R1 a b d g h f Organize spatial objects into d-dimensional rectangles. Each node in the tree corresponds to smallest d-dimensional rectangle that encloses child nodes. If an object is spatially contained in several nodes, it is only stored in one node. Tree parameters are adjusted so that small number of pages are visited during a spatial query All leaf nodes appear at same level Each leaf node is (R,O) where R is smallest rectangle containing O, e.g. R3,R4.. Each non-leaf node is (R,P) where R is smallest rectangle containing all child rectangles, e.g. R1,R2 R-tree of order (m,M) means that each node in the tree has between floor M/2 and M nodes, with exception of root node. Root node has two entries unless it is a leaf node. R-tree is not unique, rectangles depend on how objects are inserted and deleted from the tree. Problem is that to find some object you might have to go through several rectangles or whole database. Snehal Thakkar

R-Trees (Continued) Organize spatial objects into d-dimensional rectangles. Each node in the tree corresponds to smallest d-dimensional rectangle that encloses child nodes. If an object is spatially contained in several nodes, it is only stored in one node. Tree parameters are adjusted so that small number of pages are visited during a spatial query All leaf nodes appear at same level Each leaf node is (R,O) where R is smallest rectangle containing O, e.g. R3,R4…… Snehal Thakkar

R-trees (Continued) Each non-leaf node is (R,P) where R is smallest rectangle containing all child rectangles, e.g. R1,R2 R-tree of order (m,M) means that each node in the tree has between floor M/2 and M nodes, with exception of root node. Root node has two entries unless it is a leaf node. R-tree is not unique, rectangles depend on how objects are inserted and deleted from the tree. Problem is that to find some object you might have to go through several rectangles or whole database. Snehal Thakkar

R+ - Trees Decomposition of Space into Disjoint Cells R2 R3 R4 R5 R6 b d g h c i e f Snehal Thakkar

R+ Trees (Continued) R+-tree and Cell Trees used approach of discomposing space into cells R+-trees deals with collection of objects bounded by rectangles Cell tree deals with collection of objects bounded by convex polyhedra R+-trees is extension of k-d-B-tree. Try not to overlap the rectangles. If object is in multiple rectangles, it will appear multiple times. Snehal Thakkar

R+Trees(Continued) Multiple paths to object from the root Height of the tree is increased Retrieval times are smaller When summing the objects, needs eliminate duplicates It is not possible to guarantee that all properties of B-trees is fulfilled without going through difficult insert and deletion routines. It is data-dependent, so depending on how you insert or delete records R+-tree will be different. Snehal Thakkar

More Spatial Indexing Uniform Grid - Ideal for uniformly distributed data - More data-independence then R+-trees - Space decomposed on blocks on uniform size - Higher overhead Quadtree - Space is decomposed based on data points - Sensitive to positioning of the object - Width of the blocks is restricted to power of two - Good for Set-theory type operations, like composition of data. Snehal Thakkar

Region Data Focus on Interior Representation Represented as Image array of pixels Runlength Code - Break array into 1*m blocks, row representation Metal Axis Transformation (MAT) - Union of Maximal Square blocks - Blocks may overlap - Block are specified by center and radius Snehal Thakkar

More Region Data Region Quadtree - Is Metal Axis Transformation - Whose blocks are required to be disjoint - To have standard sizes(squares whose sides are power of two) - To be at standard locations - Based on successive subdivision of image array into four equal size quadrants. Snehal Thakkar

Region Quadtree A B C F 2 1 3 4 5 6 11 12 D 13 14 19 E 15 16 17 18 7 8 10 NW NE SW SE 1 2 3 4 5 13 14 19 11 12 6 15 18 17 16 7 10 9 8 Snehal Thakkar

Region Quadtree (Continued) Each leaf node is either Black or White All non-leaf nodes are Gray(Circle is previous example You can also use it for non-binary images Resolution of the decomposition may be governed by data or predetermined Can be used for several object representations. Snehal Thakkar

Variations of Quadtree Point Quadtree - Quadtree with rectangular quadrants - Adoption of Binary Search Tree to two dimensions or more - Useful for location based queries like where is nearest theatre from the location. - Descending the tree till you find the node for location based queries. - For nearest neighbor, search is continued in the neighborhood of the node containing object. - Feature based queries tough because index is based on spatial occupancy not on features. Snehal Thakkar

Variations of Quadtree Pyramid - Exponentially tapering stack of arrays, each one quarter size of previous - Useful for feature based queries like where does wheat grow in California. - Nodes that are not at maximum level of resolution contain summary information Octree - Three dimensional analog of quadtree - Recursively subdivide into eight octants Snehal Thakkar

More Variations of Quadtree Locational Code Based Quadtree - Treats image as a collection of leaf nodes, each encoded by pair of numbers - First is base 4 number, sequence of directional codes that locates leaf from the root - Second depth at which node is found or size DF-expression - Represents the image in form of traversal of nodes of its quadtree - Very Compact storage, each node type can be encoded with two bits. - Not easy to use when random access to nodes is required. Snehal Thakkar

Searching with Quadtree Useful for performing set operations When performing intersection, it only returns black node when both quadtrees have black nodes. Operation is performed using three quadtrees. Worst case scenario is sum of nodes in two quadtrees Snehal Thakkar

Algorithms with Quadtree Most algorithms are preorder traversals Execution time is linear function of number of nodes Quadtree Complexity Theorem - Number of nodes in quadtree representation is O(p+q) for 2q*2q image with perimeter p measured in pixel width. - It also holds for more dimensions. Snehal Thakkar

Point Data PR Quadtree - Regular decomposition of space into quadrants - Organized same way as the region quadtree - Leaf nodes are either empty or contain data point and its co-ordinates - A quadrant contains at most one data point - Shape of the tree is independent of the order in which points are inserted - If points are close together then decomposition can be deep - Can use quadrants with capacity c - Good for search within specified distance of given record Snehal Thakkar

PR-tree (Continued) (88,65) (52,15) (92,1) (50,50) (75,75) (25,25) (75,25) (20,88) (0,100) (100,100) (88,65) (52,15) (92,1) (0,0) (100,0) Snehal Thakkar

Rectangle Data Used to approximate other objects in the image and in VLSI design rule checking If environment is static, solution is based on use of plane sweep paradigm Any addition to database forces re-execution of algorithm on whole database Snehal Thakkar

Rectangle Data (Continued) Grid File Based Approach - Each rectangle reduced to a point in higher dimension - Made up of Cartesian product of two one dimensional intervals - Each interval is represented by center and extent - Set of intervals is represented by Grid File - Grid File uses two dimensional array of grid blocks called Grid Directory Snehal Thakkar

Rectangle Data (Continued) Grid File Based Approach (Continued) - Grid Directory has address of the bucket - Set of linear scales is kept in the core to access grid block in the grid directory - Guarantees access to record in two operations - First operation to access the grid block - Second operation to access the grid bucket Snehal Thakkar

Rectangle Data (Continued) MX-CIF Quadtree - Based on Quadtree - Decomposition of space into rectangles - Each rectangle is associated with a quadtree node corresponding to the smallest block which contains it in its entirety - Subdivision stops when nodes block contains no rectangles or at predetermined size - Rectangles can be associated with terminal and non-terminal nodes Snehal Thakkar

MX-CIF Quadtree {A,E} {B,C,D} {G} {F} A E B C D F G Snehal Thakkar

Line Data PM1 quadtree - Based on regular decomposition of space - Partitioning occurs as long as a block contains more than one line segment unless the line segments are incident at a vertex in the block - Vertex-based implementation - Useful because space requirements for polyhedral objects are smaller then conventional octree Snehal Thakkar

PM1 Quadtree(Continued) Snehal Thakkar

Line Data (Continued) PMR Quadtree - Edge-based variant of PM quatree - Uses probabilistic splitting rule - Block contains variable number of line segments - Each line segment is inserted into all blocks that it intersects or occupies - If block has more line segments than permitted, it is divided into four blocks once and only once - During deletion line segment is removed from all blocks and blocks are checked for merging Snehal Thakkar

PMR Quadtree Snehal Thakkar

PMR Quadtree Snehal Thakkar

PMR Quadtree Snehal Thakkar

Conclusion Questions ? Comments ? Email me at snehalth@usc.edu Snehal Thakkar