Issues in Spatial Database and GIS

download Issues in Spatial Database and GIS

of 66

Transcript of Issues in Spatial Database and GIS

  • 8/9/2019 Issues in Spatial Database and GIS

    1/66

    Copyright 2007 Hanan Samet

    These notes may not be reproduced by any means (mechanical or elec-tronic or any other) without express written permission of Hanan Samet

    ISSUES IN SPATIAL DATABASES AND GEOGRAPHIC

    INFORMATION SYSTEMS (GIS)

    HANAN SAMET

    COMPUTER

    SCIENCE

    DEPARTMENT AND

    CENTER FOR AUTOMATION RESEARCH ANDINSTITUTE FOR ADVANCED COMPUTER STUDIES

    UNIVERSITY OF MARYLAND

    COLLEGE PARK, MARYLAND 20742-3411 USA

  • 8/9/2019 Issues in Spatial Database and GIS

    2/66

  • 8/9/2019 Issues in Spatial Database and GIS

    3/66

    PRINCE GEORGES COUNTYhi28

    Copyright 2007 by Hanan Samet 2

  • 8/9/2019 Issues in Spatial Database and GIS

    4/66

    zk8

    BACKGROUND (A PERSONAL VIEW!)

    1. GIS originally focussed on paper map as output

    anything is better than drawing by hand no great emphasis on execution time

    2. Paper output supports high resolution

    display screen is of limited resolution

    can admit less precise algorithms

    Ex: buffer zone computation (spatial range query)

    a. usually use a Euclidean distance metric (L2)

    takes a long time

    b. can be sped up using a quadtree and aChessboard distance metric (L)

    not as accurate as Euclidean but may notbe able to perceive the difference on a displayscreen!

    as much as 3 orders of magnitude faster

    3. Users accustomed to spreadsheets

    GIS should work like a spreadsheet

    fast response time

    ability to ask what if questions and see theresults

    incorporate a database for seamless integration ofspatial and nonspatial (i.e., attribute data)

    Copyright 2007 by Hanan Samet

  • 8/9/2019 Issues in Spatial Database and GIS

    5/66

    zk9

    GENERAL SPATIAL DATABASE ISSUES

    1. Why do we want a database?

    to store data so that it can be retrieved efficiently

    should not lose sight of this purpose

    2. How to integrate spatial data with nonspatial data

    3. Long fields in relational database are not the answer

    a stopgap solution as just a repository for data

    does not aid in retrieving the data

    if data is large in volume, then breaks down astuples get very large

    4. A database is really a collection of records with fieldscorresponding to attributes of different types

    records are like points in higher dimensional space

    a. some adaptations take advantage of this analogy

    b. however, can act like a straight jacket in case of

    relational model5. Retrieval is facilitated by building an index

    need to find a way to sort the data

    index should be compatible with data being stored

    choose an appropriate zero or reference point

    need an implicit rather than an explicit index

    a. impossible to foresee all possible queries inadvance

    b. explicit would sort two-dimensional points onthe basis of distance from a particular point P impractical as sort is inapplicable to points

    different from P

    Copyright 2007 by Hanan Samet

  • 8/9/2019 Issues in Spatial Database and GIS

    6/66

    zk10

    6. Identify the possible queries and find their analogs inconventional databases

    e.g., a map in a spatial database is like a relation ina conventional database (also known as spatialrelation)

    a. difference is the presence of spatial attribute(s)

    b. also presence of spatial output

    7. How do we interact with the database?

    SQLmay not be easy to adapt

    graphical query language

    output may be visual in which case a browsingcapability (e.g., an iterator) is useful

    8. What strategy do we use in answering a query thatmixes traditional data with nontraditional data?

    need query optimization rules

    must define selectivity factors

    a. dependent on whether index exists onnontraditional data

    b. if no, then select on traditional data first

    Ex: find all cities within 100 miles of the MississippiRiver with population in excess of 1 million

    a. spatial selection first if region is small (implieshigh spatial selectivity)

    b. relational selection first if very few cities with alarge population (implies high relationalselectivity)

    Copyright 2007 by Hanan Samet

  • 8/9/2019 Issues in Spatial Database and GIS

    7/66

    zk11

    DATA IN SPATIAL DATABASES

    1. Spatial information

    locations of objects (are discrete, individual pointsin space)

    space occupied by objects (are continuous; haveextent)

    a. example objects

    lines (e.g., roads, rivers)

    regions (e.g., buildings, crop maps,polyhedra)

    others ...

    b. are objects disjoint or may they overlap?

    e.g., several crop types may be grown on aplot of land

    not concerned here with raster vs: vector issuesas these are data representationissues ratherthan data type issues

    2. Non-spatial information

    region names, postal codes, ...

    city population, year founded, ...

    road names, speed limits, ...

    Copyright 2007 by Hanan Samet

  • 8/9/2019 Issues in Spatial Database and GIS

    8/66

    hi27

    EXAMPLE QUERIES ON LINE SEGMENT DATABASES

    Queries about line segments

    1. All segments that intersect a given point or set ofpoints

    2. All segments that have a given set of endpoints

    3. All segments that intersect a given line segment

    4. All segments that are coincident with a given linesegment

    Proximity queries

    1. The nearest line segment to a given point

    2. All segments within a given distance from a givenpoint (also known as a range or window query)

    Queries involving attributes of line segments

    1. Given a point, find the closest line segment of aparticular type

    2. Given a point, find the minimum enclosing polygonwhose constituent line segments are all of a giventype

    3. Given a point, find all the polygons that are incidenton it

    Copyright 2007 by Hanan Samet 3

  • 8/9/2019 Issues in Spatial Database and GIS

    9/66

    gs10

    WHAT MAKES CONTINUOUS SPATIAL DATADIFFERENT

    1. Spatial extent of the objects is the key to thedifference

    2. A record in a DBMS may be considered as a point ina multidimensional space

    a line can be transformed (i.e., represented) as apoint in 4-d space with (x1, y1, x2, y2)

    (x2,y2)

    (x1,y1)

    good for queries about the line segments

    not good for proximity queries since points outsidethe object are not mapped into the higherdimensional space

    representative points of two objects that are

    physically close to each other in the original space(e.g., 2-d for lines) may be very far from each otherin the higher dimensional space (e.g., 4-d)

    A

    B

    Ex:

    problem is that the transformationonly transforms the space occupiedby the objects and not the rest of thespace (e.g., the query point)

    can overcome by projecting back to original space

    3. Use an index that sorts based upon spatialoccupancy (i.e., extent of the objects)

    Copyright 2007 by Hanan Samet 4

  • 8/9/2019 Issues in Spatial Database and GIS

    10/66

    hi29.1

    SPATIAL INDEXING REQUIREMENTS

    1. Compatibility with the data being stored

    2. Choose an appropriate zero or reference point

    3. Need an implicit rather than an explicit index

    impossible to foresee all possible queries inadvance

    cannot have an attribute for every possible spatialrelationship

    a. derive adjacency relations

    b. 2-d strings capture a subset of adjacencies

    all rows

    all columns

    implicit index is better as an explicit index which,for example, sorts two-dimensional data on the

    basis of distance from a given point is impracticalas it is inapplicable to other points

    implicit means that don't have to resort the data forqueries other than updates

    Copyright 2007 by Hanan Samet 5

  • 8/9/2019 Issues in Spatial Database and GIS

    11/66

    gs11

    SORTING ON THE BASIS OF SPATIAL OCCUPANCY

    Decompose the space from which the data is drawn intoregions called buckets(like hashing but preserves order)

    Interested in methods that are designed specifically forthe spatial data type being stored

    Basic approaches to decomposing space

    1. minimum bounding rectangles

    e.g., R-tree

    good at distinguishing empty and non-empty

    space drawbacks:

    a. non-disjoint decomposition of space

    may need to search entire space

    b. inability to correlate occupied and unoccupiedspace in two maps

    2. disjoint cells

    drawback: objects may be reported more than once uniform grid

    a. all cells the same size

    b. drawback: possibility of many sparse cells

    adaptive grid quadtree variants

    a. regular decomposition

    b. all cells of width power of 2

    partitions at arbitrary positionsa. drawback: not a regular decomposition

    b. e.g., R+-tree

    Can use as approximations in filter/refine queryprocessing strategy

    Copyright 2007 by Hanan Samet 6

  • 8/9/2019 Issues in Spatial Database and GIS

    12/66

    MINIMUM BOUNDING RECTANGLEShi31

    Objects grouped into hierarchies, stored in a structuresimilar to a B-tree

    Object has single bounding rectangle, yet area that itspans may be included in several bounding rectangles

    Drawback: not a disjoint decomposition of space

    Examples include the R-tree and the R*-tree

    a

    b

    c

    d

    e

    f

    g

    h

    i

    1

    b

    Order (m,M) R-tree

    1. between m M/2 and Mentries in each nodeexcept root

    2. at least 2 entries in root unless a leaf node

    Copyright 2007 by Hanan Samet 7

    2

    r

    R3

    R4

    R5

    R6

    ic feba hgd

    hi31

    R3: R4: R5: R6:Copyright 2007 by Hanan Samet 7

    3

    z

    R4R3 R6R5

    R1

    R2

    hi31

    R2:R1:

    Copyright 2007 by Hanan Samet 7

    4

    g

    R2R1

    hi31

    R0:

    R0

    Copyright 2007 by Hanan Samet 7

  • 8/9/2019 Issues in Spatial Database and GIS

    13/66

    hi32SEARCHING FOR A POINT OR LINESEGMENT IN AN R-TREE

    1

    b

    ba hgd ic fe

    R2R1

    R4R3 R6R5

    ab

    c

    d

    e

    f

    g

    h

    i

    R3

    R4

    R5

    R6

    R2

    R1

    Q

    Drawback is that may have to examine many nodes

    since a line segment can be contained in the coveringrectangles of many nodes yet its record is contained inonly one leaf node (e.g., i in R2, R3, R4, and R5)

    Ex: Search for a line segment containing point Q

    R3: R4: R5: R6:

    R1: R2:

    R0:

    R0

    Copyright 2007 by Hanan Samet 8

    hi32

    Q is in R0

    2

    v

    Copyright 2007 by Hanan Samet 8

    hi32

    Q can be in both R1 and R2

    3

    r

    Copyright 2007 by Hanan Samet 8

    hi324z

    Searching R1 first means that R4 is searched but thisleads to failure even though Q is part of i which is in R4

    Copyright 2007 by Hanan Samet 8

    hi325g

    Searching R2 finds that Q can only be in R5Copyright 2007 by Hanan Samet 8

  • 8/9/2019 Issues in Spatial Database and GIS

    14/66

    hi33DISJOINT CELLS

    Objects decomposed into disjoint subobjects; eachsubobject in different cell

    Drawback: in order to determine area covered byobject, must retrieve all cells that it occupies

    Techniques differ in degree of regularity

    R+-tree (also k-d-B-tree) and cell tree are examplesof this technique

    a

    b

    c

    d

    e

    f

    g

    h

    i

    1

    b

    Q

    Copyright 2007 by Hanan Samet 9

    hi332r

    R3

    R4

    R6

    R5

    hgd ihc ifc ba e iR3: R4: R5: R6:

    Copyright 2007 by Hanan Samet 9

    hi333z

    R4R3 R6R5

    R1

    R2

    R1: R2:

    Copyright 2007 by Hanan Samet 9

    hi334g

    R2R1R0:

    R0

    Copyright 2007 by Hanan Samet 9

  • 8/9/2019 Issues in Spatial Database and GIS

    15/66

    hi33.1K-D-B-TREES

    a

    b

    c

    d

    e

    f

    gh

    i

    1

    b

    Q

    Rectangular embedding space is hierarchicallydecomposed into disjoint rectangular regions

    No dead space in the sense that at any level of the tree,entire embedding space is covered by one of the nodes

    Blocks of k-d tree partition of space are aggregated intonodes of a finite capacity

    When a node overflows, it is split along one of the axes

    Originally developed to store points but may be extendedto non-point objects represented by their minimumbounding boxes

    Drawback: in order to determine area covered by object,must retrieve all cells that it occupies

    Copyright 2007 by Hanan Samet

    hi33.12r

    R3 R4 R6

    R5

    hgd ihc ifc ba e iR3: R4: R5: R6:Copyright 2007 by Hanan Samet

    hi33.13z

    R4R3 R6R5

    R1 R2

    R1: R2:

    Copyright 2007 by Hanan Samet

    hi33.14g

    R2R1R0:

    R0

    Copyright 2007 by Hanan Samet

  • 8/9/2019 Issues in Spatial Database and GIS

    16/66

    UNIFORM GRID

    Ideal for uniformly distributed data

    Supports set-theoretic operations

    Spatial data (e.g., line segment data) is rarely uniformlydistributed

    hi34

    Copyright 2007 by Hanan Samet 10

  • 8/9/2019 Issues in Spatial Database and GIS

    17/66

    hi35

    QUADTREES

    Hierarchical variable resolution data structure based onregular decomposition

    Many different decomposition schemes and applicableto different data types:

    1. points2. lines3. regions4. rectangles5. surfaces6. volumes7. higher dimensions including time

    changes meaning of nearesta. nearest in time, ORb. nearest in distance

    Can handle both raster and vector data as just a spatialindex

    Shape is usually independent of order of inserting data Ex: region quadtree

    A decomposition into blocks not necessarily a tree!

    Copyright 2007 by Hanan Samet 11

  • 8/9/2019 Issues in Spatial Database and GIS

    18/66

    hi36

    REGION QUADTREE

    Repeatedly subdivide until obtain homogeneous region

    For a binary image (BLACK 1 and WHITE 0) Can also use for multicolored data (e.g., a landuse

    class map associating colors with crops)

    Can also define data structure for grayscale images

    A collection of maximal blocks of size power of twoand placed at predetermined positions

    1. could implement as a list of blocks each of which

    has a unique pair of numbers: concatenate sequence of 2 bit codes correspond-ing to the path from the root to the blocks node

    the level of the blocks node

    2. does not have to be implemented as a tree tree good for logarithmic access

    A variable resolution data structure in contrast to apyramid (i.e., a complete quadtree) which is a

    multiresolution data structure

    A

    B C D E

    NW

    NE SW

    SE

    F G H I J L M N O Q

    K P

    37 38 39 40 57 58 59 60

    0

    0

    0

    0

    0

    0

    0

    0

    0

    0

    0

    0

    0

    0

    0

    0

    0

    0

    0

    0

    0

    1

    1

    1

    0

    0

    0

    0

    1

    1

    1

    1

    0

    0

    1

    1

    1

    1

    1

    1

    0

    0

    1

    1

    1

    1

    1

    0

    0

    0

    1

    1

    1

    1

    0

    0

    0

    0

    1

    1

    1

    1

    0

    0

    B

    60

    37

    L

    J

    Q

    GF

    H

    N

    I

    O

    M 5758

    59

    4039

    38

    Copyright 2007 by Hanan Samet 12

  • 8/9/2019 Issues in Spatial Database and GIS

    19/66

    hi37

    PYRAMID

    Internal nodes contain summary of information innodes below them

    Useful for avoiding inspecting nodes where there couldbe no relevant information

    c1

    c2

    c3

    c4

    c5

    c6

    {c1,c2,c3,c4,c5,c6}

    {c2,c3,c6} {c2,c3,c4,c5}

    {c1,c2,c3,c4,c5,c6}

    {c6}

    Copyright 2007 by Hanan Samet 13

  • 8/9/2019 Issues in Spatial Database and GIS

    20/66

    hi38

    QUADTREES VS. PYRAMIDS

    Quadtrees are good for location-based queries

    1. e.g., what is at location x?2. not good if looking for a particular feature as have toexamine every block or location asking are you theone I am looking for?

    Pyramid is good for feature-based queries e.g.,

    1. does wheat exist in region x? if wheat does not appear at the root node, then

    impossible to find it in the rest of the structure and

    the search can cease2. report all crops in region x just look at the root

    3. select all locations where wheat is grown only descend node if there is possibility that wheat is

    in one of its four sons implies little wasted work

    Ex: truncated pyramid where 4 identically-colored sonsare merged

    c1

    c2

    c3

    c4

    c5

    c6

    {c1,c2,c3,c4,c5,c6}

    {c2,c3,c6} {c2,c3,c4,c5}

    {c1,c2,c3,c4,c5,c6}

    {c6}

    {c2,c3,c5} {c1,c2,c3,c5}

    Can represent as a list of leaf and nonleaf blocks (e.g.,as a linear quadtree)

    Copyright 2007 by Hanan Samet 14

  • 8/9/2019 Issues in Spatial Database and GIS

    21/66

    PR QUADTREE (Orenstein)1 hp9b

    Regular decomposition point representation

    Decomposition occurs whenever a block contains more

    than one pointUseful when the domain of data points is not discretebut finite

    (0,100) (100,100)

    (100,0)(0,0)

    (35,42)

    Chicago

    Maximum level of decomposition depends on theminimum separation between two points

    if two points are very close, then decomposition can bevery deep

    can be overcome by viewing blocks as buckets withcapacity cand only decomposing the block when itcontains more than cpoints

    1.

    2.

    3.

    4.

    Ex:c= 1

    Copyright 2007 by Hanan Samet 15

    2

    rhp9

    (52,10)

    Mobile

    Copyright 2007 by Hanan Samet 15

    3

    zhp9

    (62,77)

    Toronto

    Copyright 2007 by Hanan Samet 15

    4

    ghp9

    (82,65)

    Buffalo

    Copyright 2007 by Hanan Samet 15

    5

    vhp9

    (5,45)

    Denver

    Copyright 2007 by Hanan Samet 15

    6

    ghp9

    (27,35)

    Omaha

    Copyright 2007 by Hanan Samet 15

    7

    zhp9

    (85,15)Atlanta

    Copyright 2007 by Hanan Samet 15

    8

    rhp9

    (90,5)

    Miami

    Copyright 2007 by Hanan Samet 15

  • 8/9/2019 Issues in Spatial Database and GIS

    22/66

    REGION SEARCH1 hp10b

    Use of quadtree results in pruning the search space

    Ex: Find all points within radius rof point A

    A

    r

    Copyright 2007 by Hanan Samet 16

    hp10

    If a quadrant subdivision point plies in a region l, thensearch the quadrants of pspecified by l

    1. SE 6. NE 11. All but SW

    2. SE, SW 7. NE, NW 12. All but SE3. SW 8. NW 13. All4. SE, NE 9. All but NW5. SW, NW 10. All but NE

    1 2 39 10

    13

    1211

    45

    876

    2

    r

    Copyright 2007 by Hanan Samet 16

    hp103z

    Copyright 2007 by Hanan Samet 16

  • 8/9/2019 Issues in Spatial Database and GIS

    23/66

    hp11FINDING THE NEAREST OBJECT

    Ex: find the nearest object to P

    1

    b

    P

    12 8 7 6

    13 9 1 4 5

    2 3

    10 11

    D

    E C

    F

    A

    B

    Assume PRquadtree for points (i.e., at most one point per block) Search neighbors of block 1 in counterclockwise order Points are sorted with respect to the space they occupy which enables pruning the search space

    Algorithm:

    Copyright 2007 by Hanan Samet 17

    hp112r

    1. start at block 2 and compute distance to Pfrom A

    Copyright 2007 by Hanan Samet 17

    hp113z

    2. ignore block 3 whether or not it is empty as Ais closer to Pthan any point in 3

    Copyright 2007 by Hanan Samet 17

    hp114g

    3. examine block 4 as distance to SWcorner is shorter than the distance from Pto A; however, reject Bas it is further from Pthan A

    Copyright 2007 by Hanan Samet 17

    hp115v

    4. ignore blocks 6, 7, 8, 9, and 10 as the minimum distance to them from Pis greater than the distance

    from Pto A

    Copyright 2007 by Hanan Samet 17

    hp116z

    5. examine block 11 as the distance from Pto the southern border of 1 is shorter than the distance from Pto A; however, reject Fas it is further from Pthan A

    Copyright 2007 by Hanan Samet 17

    hp117r

    If Fwas moved, a better order would have started withblock 11, the southern neighbor of 1, as it is closest

    new F

    Copyright 2007 by Hanan Samet 17

  • 8/9/2019 Issues in Spatial Database and GIS

    24/66

    cd32

    a

    PM1 QUADTREE

    1

    DECOMPOSITION RULE:

    Partitioning occurs when a block contains more thanone segment unless all the segments are incident atthe same vertex which is also in the same block

    b

    Vertex-based (one vertex per block)

    Shape independent of order of insertion

    Copyright 2007 by Hanan Samet 18

    cd32

    b

    2

    r

    Copyright 2007 by Hanan Samet 18

    cd323z

    c

    Copyright 2007 by Hanan Samet 18

    cd324g

    d

    Copyright 2007 by Hanan Samet 18

    cd325v

    e

    Copyright 2007 by Hanan Samet 18

    cd32

    f

    6

    r

    Copyright 2007 by Hanan Samet 18

    cd327z

    g

    Copyright 2007 by Hanan Samet 18

    cd32

    h

    8

    g

    Copyright 2007 by Hanan Samet 18

    cd32

    i

    9

    v

    Copyright 2007 by Hanan Samet 18

  • 8/9/2019 Issues in Spatial Database and GIS

    25/66

    cd35

    a

    PMR QUADTREE 1

    Split a block onceif upon insertion the number ofsegments intersecting a block exceeds N

    b

    Edge-based

    Avoids having to split many times when two vertices orlines are very close as in PM1 quadtree

    Probabilistic splitting and merging rules

    Uses a splitting threshold value say N

    DECOMPOSITION RULE:

    Merge a block with its siblings if the total number of line

    segments intersecting them is less than N

    Merges can be performed more than once Does not guarantee that each block will contain at

    mostNline segments

    Splitting threshold is not the same as bucket capacity

    Shape depends on order of insertion

    Ex:N= 2

    Copyright 2007 by Hanan Samet 19

    cd352r

    b

    Copyright 2007 by Hanan Samet 19

    cd353z

    c

    Copyright 2007 by Hanan Samet 19

    cd35

    d

    4

    g

    Copyright 2007 by Hanan Samet 19

    cd355v

    e

    Copyright 2007 by Hanan Samet 19

    cd35

    f

    6

    r

    Copyright 2007 by Hanan Samet 19

    cd35

    g

    7

    z

    Copyright 2007 by Hanan Samet 19

    cd35

    h

    8

    g

    Copyright 2007 by Hanan Samet 19

    cd35

    i

    9

    v

    Copyright 2007 by Hanan Samet 19

  • 8/9/2019 Issues in Spatial Database and GIS

    26/66

    ADVANTAGES OF EDGE-BASED METHODS

    The decomposition is focussed where the line segmentsare the densest

    Handles the situation that several non-intersecting linesare very close to each other

    cd46

    Able to represent nonplanar line segment data

    Good average behavior in terms of node occupancy

    Example:

    PM1 PMR (N=2)

    Copyright 2007 by Hanan Samet 20

  • 8/9/2019 Issues in Spatial Database and GIS

    27/66

    CONSISTENCY OF PM APPROACHcd47

    Stores lines exactly

    Each line segment is represented by a pointer to a

    record containing its endpoints

    Updates can be made in a consistent manner - i.e.,when a vector feature is deleted, the database can berestored to the state it would have been in had thedeleted feature never been inserted

    Uses the decomposition induced by the quadtree tospecify what parts of the line segments (i.e., q-edges)are actually present

    1. not a digitized representation2. no thickness associated with line segments

    The line segment descriptor stored in a block onlyimplies the presence of the corresponding q-edge - itdoes not mean that the entire line segment is present

    as a lineal feature

    Useful for representing fragments of lines such asthose that result from the intersection of a line map withan area map

    Ex:

    1

    b

    Copyright 2007 by Hanan Samet 21

    2

    rcd47

    Copyright 2007 by Hanan Samet 21

    3

    zcd47

    Copyright 2007 by Hanan Samet 21

  • 8/9/2019 Issues in Spatial Database and GIS

    28/66

    MAXIMAL SEARCH RADIUS

    P

    cd58

    Properties of the PM quadtree family (PM1, PMR, etc.)greatly localize the search area for nearest line segment

    Assume that the query point P falls in the SW corner ofthe small highlighted block

    By virtue of the existence of a block of this size, we areguaranteed that at least one of the remainingsiblings contains a line segment

    1

    b

    Copyright 2007 by Hanan Samet 22

    2

    r

    three

    cd58

    Copyright 2007 by Hanan Samet 22

    3

    zcd58

    Copyright 2007 by Hanan Samet 22

  • 8/9/2019 Issues in Spatial Database and GIS

    29/66

    cd59NEAREST LINE SEGMENT ALGORITHM

    A four stage intelligent search process

    Maximal search radius equal to length of parent node'sdiagonal

    Basic algorithm:

    Search the block containing the query point1.

    1

    b

    Copyright 2007 by Hanan Samet 23

    2

    Search the three siblings2.

    rcd59

    Copyright 2007 by Hanan Samet 23

    3

    Search the three regions of size equal to that of theparent that are incident to the block containing thequery point

    3.

    zcd59

    Copyright 2007 by Hanan Samet 23

    4

    Search the final four groups of two adjacent blocksto the previous step

    4.

    gcd59

    Copyright 2007 by Hanan Samet 23

  • 8/9/2019 Issues in Spatial Database and GIS

    30/66

    hp14MX-CIF QUADTREE (Kedem)

    1

    b

    Collections of small rectangles for VLSI applications

    Each rectangle is associated with its minimum

    enclosing quadtree blockLike hashing: quadtree blocks serve as hash buckets

    1.

    2.

    3.

    1

    2

    3

    45

    6

    9

    87

    10

    11

    12

    D {11}

    F {12}E {3,4,5}

    B {1}

    A {2,6,7,8,9,10}

    C {}

    A

    B

    C

    E

    D

    F

    Copyright 2007 by Hanan Samet 24

    hp142r

    Collision = more than one rectangle in a block

    resolve by using two one-dimensional MX-CIF trees tostore the rectangle intersecting the lines passingthrough each subdivision point

    4.

    Copyright 2007 by Hanan Samet 24

    hp14

    one for y-axis

    Binary tree for y-axis through A

    Y1

    Y2 10

    Y4

    2

    Y5

    Y3

    6Y7

    8

    Y6

    3

    g

    Copyright 2007 by Hanan Samet 24

    hp14

    if a rectangle intersects both xand yaxes, thenassociate it with the yaxis

    4

    v

    Copyright 2007 by Hanan Samet 24

    hp145z

    one for x-axis

    Binary tree for x-axis through A

    X1

    X39

    X5

    7

    X4

    X2

    X6

    Copyright 2007 by Hanan Samet 24

  • 8/9/2019 Issues in Spatial Database and GIS

    31/66

    sf2

    HIERARCHICAL RECTANGULAR DECOMPOSITION

    Similar to triangular decomposition

    Good when data points are the vertices of arectangular grid

    Drawback is absence of continuity between adjacentpatches of unequal width (termed the alignmentproblem)

    Overcoming the presence of cracks

    1. use the interpolated point instead of the true point(Barrera and Hinjosa)

    2. triangulate the squares (Von Herzen and Barr)

    can split into 2, 4, or 8 triangles depending on howmany lines are drawn through the midpoint

    if split into 2 triangles, then cracks still remain

    no cracks if split into 4 or 8 triangles

    Copyright 2007 by Hanan Samet 25

  • 8/9/2019 Issues in Spatial Database and GIS

    32/66

    sf31b

    RESTRICTED QUADTREE (VON HERZEN/BARR)

    All 4-adjacent blocks are either of equal size or of ratio 2:1

    Note: also used in finite element analysis to adptivelyrefine an element as well as to achieve elementcompatibility (termed h-refinementby Kela, Perucchio, andVoelcker)

    Copyright 2007 by Hanan Samet 26

    sf32r

    Copyright 2007 by Hanan Samet 26

    sf33z

    8-triangle decomposition rule1. decompose each block into 8 triangles (i.e., 2 triangles

    per edge)

    2. unless the edge is shared by a larger block

    3. in which case only 1 triangle is formed

    Copyright 2007 by Hanan Samet 26

    sf34g

    4-triangle decomposition rule

    1. decompose each block into 4 triangles (i.e., 1 triangleper edge)

    2. unless the edge is shared by a smaller block

    3. in which case 2 triangles are formed along the edge

    Copyright 2007 by Hanan Samet 26

    sf3

    Prefer 8-triangle rule as it is better for display applications(shading)

    5

    v

    Copyright 2007 by Hanan Samet 26

  • 8/9/2019 Issues in Spatial Database and GIS

    33/66

    sf4

    PROPERTY SPHERES (FEKETE)

    Approximation of spherical data

    Uses icosahedron which is a Platonic solid

    1. 20 faceseach is a regular triangle

    2. largest possible regular polyhedron

    Copyright 2007 by Hanan Samet 27

  • 8/9/2019 Issues in Spatial Database and GIS

    34/66

    sf5

    ALTERNATIVE SPHERICAL APPROXIMATIONS

    Could use other Platonic solids

    1. all have faces that are regular polygons

    tetrahedron: 4 equilateral triangular faces

    hexahedron: 6 square faces

    octahedron: 8 equilateral triangular faces

    dodecahedron: 12 pentagonal faces

    2. octahedron is nice for modeling the globe

    it can be aligned so that the poles are at oppositevertices

    the prime meridian and the equator intersect atanother vertex

    one subdivision line of each face is parallel to theequator

    Decompose on the basis of latitude and longitudevalues

    1. not so good if want a partition into units of equalarea as great problems around the poles

    2. project sphere onto plane using Lambertscylindrical projection which is locally area preserving

    Instead of approximating sphere with the solids,project the faces of the solids on the sphere (Scott)

    1. all edges become sub-arcs of a great circle

    2. use regular decomposition on triangular, square, orpentagonal spherical surface patches

    Copyright 2007 by Hanan Samet 28

  • 8/9/2019 Issues in Spatial Database and GIS

    35/66

    hi60

    OCTREES

    1. Interior (voxels)

    analogous to region quadtree approximate object by aggregating similar voxels

    good for medical images but not for objects withplanar faces

    Ex:

    1 2 3 4 13 14 15

    12111098765

    B

    A14 15

    49 10

    6

    1 2

    13

    1211

    5

    2. Boundary

    adaptation of PM quadtree to three-dimensionaldata

    decompose until each block containsa. one face

    b. more than one face but all meet at same edge

    c. more than one edge but all meet at samevertex

    impose a spatial index on a boundary model(BRep)

    Copyright 2007 by Hanan Samet 29

  • 8/9/2019 Issues in Spatial Database and GIS

    36/66

    hi39

    EXAMPLE QUADTREE-BASED QUERY

    Query: find all cities with population in excess of 5,000 inwheat growing regions within 10 miles of the Mississippi

    River1. assume river is a linear feature

    use a line map could be a region if asked for sandbars in the river

    2. region map for the wheat3. assume cities are points

    point map for cities

    could be region is asked for high income areas

    Combines spatial and non-spatial (i.e., attribute) data

    Many possible execution plans - e.g.,

    1. compute buffer or corridor around river2. extract wheat area3. intersect 1 with 2

    4. intersect city map with 35. retrieve value of population attribute for cities in 4 fromthe nonspatial database (e.g., relational)

    Regular decomposition hierarchical data structures suchas the quadtree

    1. all maps are in registration

    all blocks are in the same positions

    not true for R+-trees and BSP trees disjoint decomposition of space - unlike R-tree

    2. can perform set-theoretic operations on differentfeature types (e.g., 3 and 4)

    Copyright 2007 by Hanan Samet

  • 8/9/2019 Issues in Spatial Database and GIS

    37/66

    zk26

    SAND BROWSER: A SPATIO-RELATIONALBROWSER

    Assume a relational database

    Relations have spatial and nonspatial attributes

    Browse through tuples or objects (groups of tupleswith similar attribute values) of a relation one at a timeaccording to values within ranges of the

    1. nonspatial attributes

    2. underlying space in which the objects correspond-ing to the spatial attributes are embedded

    Make use of indexes to facilitate viewing (termedranking) tuples in order of nearness to a referenceattribute value (e.g., zero, origin, etc.) and obtain tuplesin this order

    Graphical user interface instead of SQLbut functionally

    equivalent Graphical result of spatial and nonspatial queries

    Output

    1. display tuples satisfying the query one tuple or oneobject at a time

    show the values of all of the attributes of the most

    recently generated tuple cursor points at this tuple

    2. cumulative display of spatial attributes

    Can save the result of an operation as a relation forfuture operations (SAVE GROUP)

    Copyright 2007 by Hanan Samet 2

  • 8/9/2019 Issues in Spatial Database and GIS

    38/66

    zk36

    SPECIFIC SPATIAL DATABASE ISSUES

    1. Representation

    bounding boxes versus disjoint decomposition

    2. How are spatial integrity constraints captured andassured?

    edges of a polygon link to form a complete object

    line segments do not intersect except at vertices

    contour lines should not cross

    3. Interaction with the relational model

    spatial operations dont fit into SQL

    a. buffer

    b. nearest to ...

    c. others ...

    difficult to capture hierarchy of complex objects

    (e.g., nested definition)

    4. Spatial input is visual

    need a graphical query language

    Copyright 2007 by Hanan Samet 2

  • 8/9/2019 Issues in Spatial Database and GIS

    39/66

    zk37

    5. Spatial output is visual

    unlike conventional databases, once operation iscomplete, want to browse entire output togetherrather than one tuple at-a-time

    dont want to wait for operation to complete beforeoutput

    a. partial visual output is preferable

    e.g., incremental spatial join and nearestneighbor

    b. multiresolution output is attractive

    6. Functionality

    determining what people really want to do!

    7. Performance

    not enough to just measure the execution time ofan operation

    time to load a spatial index and build a spatially-indexed output is important

    sequence of spatial operations as in a spatialspreadsheet

    a. output of one operation serves as input toanother

    e.g., cascaded spatial join

    b. spatial join yields locations of objects and notjust the object pairs

    Copyright 2007 by Hanan Samet 2

  • 8/9/2019 Issues in Spatial Database and GIS

    40/66

    zk38

    CHALLENGES:

    1. Incorporation of geometry into database querieswithout user being aware of it!

    find geometric analogs of conventional databaseoperations (e.g., ranking semi-join yields discreteVoronoi diagram)

    extension of browser concept to permit moregeneral browsing units based on connectivity (e.g.,shortest path), frequency, etc.

    2. Spatial query optimization

    different query execution plans use spatial selectivity factors to choose among them

    3. Graphical query specification instead of SQL

    4. Incorporation of time-varying data

    how to represent rates?

    5. Incorporation of imagery

    6. Develop spatial indices that support both location-based (what is at X?) and feature-based queries(where is Y?)

    7. Incorporate rendering attributes into databaseobjects or relations

    queries based on the rendering attributes

    Ex: find all red regions

    query by content (e.g., image databases)

    8. GIS on the Web and distributed data and algorithms

    9. Knowledge discovery

    10. Interoperability

    Copyright 2007 by Hanan Samet 2

  • 8/9/2019 Issues in Spatial Database and GIS

    41/66

    IEEE Internet Computing, 11(1):5259,world wide web.

    Structures, MorganKaufmann, San Francisco, 2006.

    AddisonWesley, Reading, MA, 1990.

    [http://www.cs.umd.edu/~hjs/multidimensionalbookflyer.pdf]

    Reading, MA, 1990. Graphics, Image Processing, and GIS, AddisonWesley,

    2. H. Samet, Foundations of Multidimensional and Metric Data

    3. H. Samet, Applications of Spatial Data Structures: Computer

    4. H. Samet, Design and Analysis of Spatial Data Structures,

    5. Spatial Data Applets at http://www.cs.umd.edu/~hjs/quadtree

    FURTHER READING rf1

    Copyright 2007 by Hanan Samet

    1. F. Brabec and H. Samet, Clientbased spatial browsing on the

    Jan/Feb 2007.

  • 8/9/2019 Issues in Spatial Database and GIS

    42/66

  • 8/9/2019 Issues in Spatial Database and GIS

    43/66

    1 I n t r o d u c t i o n

    S p a t i a l d a t a c o n s i s t s o f s p a t i a l o b j e c t s m a d e u p o f p o i n t s , l i n e s , r e g i o n s , r e c t a n g l e s , s u r f a c e s ,

    v o l u m e s , a n d e v e n d a t a o f h i g h e r d i m e n s i o n w h i c h i n c l u d e s t i m e . E x a m p l e s o f s p a t i a l d a t a

    i n c l u d e c i t i e s , r i v e r s , r o a d s , c o u n t i e s , s t a t e s , c r o p c o v e r a g e s , m o u n t a i n r a n g e s , p a r t s i n a

    C A D s y s t e m , e t c . E x a m p l e s o f s p a t i a l p r o p e r t i e s i n c l u d e t h e e x t e n t o f a g i v e n r i v e r , o r t h e

    b o u n d a r y o f a g i v e n c o u n t y , e t c . O f t e n i t i s a l s o d e s i r a b l e t o a t t a c h n o n - s p a t i a l a t t r i b u t e

    i n f o r m a t i o n s u c h a s e l e v a t i o n h e i g h t s , c i t y n a m e s , e t c . t o t h e s p a t i a l d a t a . S p a t i a l d a t a b a s e s

    f a c i l i t a t e t h e s t o r a g e a n d e c i e n t p r o c e s s i n g o f s p a t i a l a n d n o n - s p a t i a l i n f o r m a t i o n i d e a l l y

    w i t h o u t f a v o r i n g o n e o v e r t h e o t h e r . S u c h d a t a b a s e s a r e n d i n g i n c r e a s i n g u s e i n a p p l i -

    c a t i o n s i n e n v i r o n m e n t a l m o n i t o r i n g , s p a c e , u r b a n p l a n n i n g , r e s o u r c e m a n a g e m e n t , a n d

    g e o g r a p h i c i n f o r m a t i o n s y s t e m s G I S B u c h m a n n e t a l . 1 9 9 0 ; G u n t h e r a n d S c h e k 1 9 9 1 .

    A c o m m o n w a y t o d e a l w i t h s p a t i a l d a t a i s t o s t o r e i t e x p l i c i t l y b y p a r a m e t r i z i n g i t a n d

    t h e r e b y o b t a i n i n g a r e d u c t i o n t o a p o i n t i n a p o s s i b l y h i g h e r d i m e n s i o n a l s p a c e . T h i s i s

    u s u a l l y q u i t e e a s y t o d o i n a c o n v e n t i o n a l d a t a b a s e m a n a g e m e n t s y s t e m s i n c e t h e s y s t e m i s

    j u s t a c o l l e c t i o n o f r e c o r d s , w h e r e e a c h r e c o r d h a s m a n y e l d s . I n p a r t i c u l a r , w e s i m p l y a d d

    a e l d o r s e v e r a l e l d s t o t h e r e c o r d t h a t d e a l s w i t h t h e d e s i r e d i t e m o f s p a t i a l i n f o r m a t i o n .

    T h i s a p p r o a c h i s n e i f w e j u s t w a n t t o p e r f o r m a s i m p l e r e t r i e v a l o f t h e d a t a .

    H o w e v e r , i f o u r q u e r y i n v o l v e s t h e s p a c e o c c u p i e d b y t h e d a t a a n d h e n c e o t h e r r e c o r d s

    b y v i r t u e o f t h e i r p r o x i m i t y , t h e n t h e s i t u a t i o n i s n o t s o s t r a i g h t f o r w a r d . I n s u c h a c a s e

    w e n e e d t o b e a b l e t o r e t r i e v e r e c o r d s b a s e d o n s o m e s p a t i a l p r o p e r t i e s w h i c h a r e n o t

    s t o r e d e x p l i c i t l y i n t h e d a t a b a s e . F o r e x a m p l e , i n a r o a d s d a t a b a s e , w e m a y n o t w i s h t o

    f o r c e t h e u s e r t o s p e c i f y e x p l i c i t l y w h i c h r o a d s i n t e r s e c t w h i c h o t h e r r o a d s o r r e g i o n s . T h e

    p r o b l e m i s t h a t t h e p o t e n t i a l v o l u m e o f s u c h i n f o r m a t i o n m a y b e v e r y l a r g e a n d t h e c o s t

    o f p r e p r o c e s s i n g i t h i g h , w h i l e t h e c o s t o f c o m p u t i n g i t o n t h e y m a y b e q u i t e r e a s o n a b l e ,

    e s p e c i a l l y i f t h e s p a t i a l d a t a i s s t o r e d i n a n a p p r o p r i a t e m a n n e r . T h u s w e p r e f e r t o s t o r e

    t h e d a t a i m p l i c i t l y s o t h a t a w i d e c l a s s o f s p a t i a l q u e r i e s c a n b e h a n d l e d . I n p a r t i c u l a r , w e

    n e e d n o t k n o w t h e t y p e s o f q u e r i e s a p r i o r i .

    B e i n g a b l e t o r e s p o n d t o s p a t i a l q u e r i e s i n a e x i b l e m a n n e r p l a c e s a p r e m i u m o n t h e

    a p p r o p r i a t e r e p r e s e n t a t i o n o f t h e s p a t i a l d a t a . I n o r d e r t o b e a b l e t o d e a l w i t h p r o x i m i t y

    q u e r i e s t h e d a t a m u s t b e s o r t e d . O f c o u r s e , a l l d a t a b a s e m a n a g e m e n t s y s t e m s s o r t t h e

    d a t a . T h e i s s u e i s w h i c h k e y s d o t h e y s o r t o n . I n t h e c a s e o f s p a t i a l d a t a , t h e s o r t s h o u l d b e

    b a s e d o n a l l o f t h e s p a t i a l k e y s , w h i c h m e a n s t h a t , u n l i k e c o n v e n t i o n a l d a t a b a s e m a n a g e m e n t

    s y s t e m s , t h e s o r t i s b a s e d o n t h e s p a c e o c c u p i e d b y t h e d a t a . S u c h t e c h n i q u e s a r e k n o w n

    s p a t i a l i n d e x i n g m e t h o d s .

    O n e a p p r o a c h t o t h e r e p r e s e n t a t i o n o f s p a t i a l d a t a i s t o s e p a r a t e i t s t r u c t u r a l l y f r o m

    t h e n o n s p a t i a l d a t a w h i l e m a i n t a i n i n g a p p r o p r i a t e l i n k s b e t w e e n t h e t w o A r e f a n d S a m e t

    1 9 9 1 a . T h i s l e a d s t o a m u c h h i g h e r b a n d w i d t h f o r t h e r e t r i e v a l o f t h e s p a t i a l d a t a . I n

    s u c h a c a s e , t h e s p a t i a l o p e r a t i o n s a r e p e r f o r m e d d i r e c t l y o n t h e s p a t i a l d a t a s t r u c t u r e s .

    T h i s p r o v i d e s t h e f r e e d o m t o c h o o s e a m o r e a p p r o p r i a t e s p a t i a l s t r u c t u r e t h a n t h e i m p o s e d

    n o n - s p a t i a l s t r u c t u r e e . g . , a r e l a t i o n a l d a t a b a s e . I n s u c h a c a s e , a s p a t i a l p r o c e s s o r c a n

    b e u s e d t h a t i s s p e c i c a l l y d e s i g n e d f o r e c i e n t l y d e a l i n g w i t h t h e p a r t o f t h e q u e r i e s t h a t

    i n v o l v e p r o x i m i t y r e l a t i o n s a n d s e a r c h , a n d a r e l a t i o n a l d a t a b a s e m a n a g e m e n t s y s t e m f o r

    t h e p a r t o f t h e q u e r i e s t h a t i n v o l v e n o n - s p a t i a l d a t a . I t s p r o p e r f u n c t i o n i n g d e p e n d s o n t h e

    e x i s t e n c e o f a q u e r y o p t i m i z e r t o d e t e r m i n e t h e a p p r o p r i a t e p r o c e s s o r f o r e a c h p a r t o f t h e

  • 8/9/2019 Issues in Spatial Database and GIS

    44/66

    q u e r y A r e f a n d S a m e t 1 9 9 1 b .

    A s a n e x a m p l e o f t h e t y p e o f q u e r y t o b e p o s e d t o a s p a t i a l d a t a b a s e s y s t e m , c o n s i d e r

    a r e q u e s t t o n d t h e n a m e s o f t h e r o a d s t h a t p a s s t h r o u g h t h e U n i v e r s i t y o f M a r y l a n d

    r e g i o n " . T h i s r e q u i r e s t h e e x t r a c t i o n o f t h e r e g i o n l o c a t i o n s o f a l l t h e d a t a b a s e r e c o r d s

    w h o s e r e g i o n n a m e " e l d h a s t h e v a l u e U n i v e r s i t y o f M a r y l a n d " a n d b u i l d a m a p

    N e x t , m a p i s i n t e r s e c t e d w i t h t h e r o a d m a p t o y i e l d a n e w m a p w i t h t h e s e l e c t e d

    r o a d s . N o w , c r e a t e a n e w r e l a t i o n h a v i n g j u s t o n e a t t r i b u t e w h i c h i s t h e r e l e v a n t r o a d

    n a m e s o f t h e r o a d s i n m a p . O f c o u r s e , t h e r e a r e o t h e r a p p r o a c h e s t o a n s w e r i n g t h e a b o v e

    q u e r y . T h e i r e c i e n c y d e p e n d s o n t h e n a t u r e o f t h e d a t a a n d i t s v o l u m e .

    I n t h e r e s t o f t h i s r e v i e w w e c o n c e n t r a t e o n t h e d a t a s t r u c t u r e s u s e d b y t h e s p a t i a l

    p r o c e s s o r . I n p a r t i c u l a r , w e f o c u s o n h i e r a r c h i c a l d a t a s t r u c t u r e s . T h e y a r e b a s e d o n t h e

    p r i n c i p l e o f r e c u r s i v e d e c o m p o s i t i o n s i m i l a r t o d i v i d e a n d c o n q u e r m e t h o d s . T h e t e r m

    q u a d t r e e i s o f t e n u s e d t o d e s c r i b e m a n y e l e m e n t s o f t h i s c l a s s o f d a t a s t r u c t u r e s . W e

    c o n c e n t r a t e p r i m a r i l y o n r e g i o n , p o i n t , r e c t a n g l e , a n d l i n e d a t a . F o r a m o r e e x t e n s i v e

    t r e a t m e n t o f t h i s s u b j e c t , s e e S a m e t 1 9 9 0 a ; S a m e t 1 9 9 0 b .

    O u r p r e s e n t a t i o n i s o r g a n i z e d a s f o l l o w s . S e c t i o n 2 d e s c r i b e s a n u m b e r o f d i e r e n t

    m e t h o d s o f i n d e x i n g s p a t i a l d a t a . S e c t i o n 3 f o c u s s e s o n r e g i o n d a t a a n d a l s o b r i e y r e v i e w s

    t h e h i s t o r i c a l b a c k g r o u n d o f t h e o r i g i n s o f h i e r a r c h i c a l s p a t i a l d a t a s t r u c t u r e s s u c h a s t h e

    q u a d t r e e . S e c t i o n s 4 , 5 , a n d 6 d e s c r i b e h i e r a r c h i c a l r e p r e s e n t a t i o n s f o r p o i n t , r e c t a n g l e ,

    a n d l i n e d a t a , r e s p e c t i v e l y , a s w e l l a s g i v e e x a m p l e s o f t h e i r u t i l i t y . S e c t i o n 7 c o n t a i n s

    c o n c l u d i n g r e m a r k s i n t h e c o n t e x t o f a g e o g r a p h i c i n f o r m a t i o n s y s t e m t h a t m a k e s u s e o f

    t h e s e c o n c e p t s .

    2 S p a t i a l I n d e x i n g

    E a c h r e c o r d i n a d a t a b a s e m a n a g e m e n t s y s t e m c a n b e c o n c e p t u a l i z e d a s a p o i n t i n a m u l t i -

    d i m e n s i o n a l s p a c e . T h i s a n a l o g y i s u s e d b y m a n y r e s e a r c h e r s e . g . , H i n r i c h s a n d N i e v e r g e l t

    1 9 8 3 ; J a g a d i s h 1 9 9 0 t o d e a l w i t h s p a t i a l d a t a a s w e l l b y u s e o f s u i t a b l e t r a n s f o r m a t i o n s

    t h a t m a p t h e s p a t i a l o b j e c t h e n c e f o r t h w e j u s t u s e t h e t e r m o b j e c t i n t o a p o i n t t e r m e d a

    r e p r e s e n t a t i v e p o i n t i n e i t h e r t h e s a m e e . g . , J a g a d i s h 1 9 9 0 , l o w e r e . g . , O r e n s t e i n a n d

    M e r r e t t 1 9 8 4 , o r h i g h e r e . g . , H i n r i c h s a n d N i e v e r g e l t 1 9 8 3 d i m e n s i o n a l s p a c e s . T h i s

    a n a l o g y i s n o t a l w a y s a p p r o p r i a t e f o r s p a t i a l d a t a . O n e p r o b l e m i s t h a t t h e d i m e n s i o n a l i t y

    o f t h e r e p r e s e n t a t i v e p o i n t m a y b e t o o h i g h O r e n s t e i n 1 9 8 9 . O n e s o l u t i o n i s t o a p p r o x i -

    m a t e t h e s p a t i a l o b j e c t b y r e d u c i n g t h e d i m e n s i o n a l i t y o f t h e r e p r e s e n t a t i v e p o i n t . A n o t h e r

    m o r e s e r i o u s p r o b l e m i s t h a t u s e o f t h e s e t r a n s f o r m a t i o n s d o e s n o t p r e s e r v e p r o x i m i t y .

    T o s e e t h e d r a w b a c k o f j u s t m a p p i n g s p a t i a l d a t a i n t o p o i n t s i n a n o t h e r s p a c e , c o n s i d e r

    t h e r e p r e s e n t a t i o n o f a d a t a b a s e o f l i n e s e g m e n t s . W e u s e t h e t e r m p o l y g o n a l m a p t o r e f e r

    t o s u c h a l i n e s e g m e n t d a t a b a s e , c o n s i s t i n g o f v e r t i c e s a n d e d g e s , r e g a r d l e s s o f w h e t h e r o r

    n o t t h e l i n e s e g m e n t s a r e c o n n e c t e d t o e a c h o t h e r . S u c h a d a t a b a s e c a n a r i s e i n a n e t w o r k

    o f r o a d s , p o w e r l i n e s , r a i l l i n e s , e t c . U s i n g a r e p r e s e n t a t i v e p o i n t e . g . , J a g a d i s h 1 9 9 0 ,

    e a c h l i n e s e g m e n t c a n b e r e p r e s e n t e d b y i t s e n d p o i n t s . T h i s m e a n s t h a t e a c h l i n e s e g m e n t

    i s r e p r e s e n t e d b y a t u p l e o f f o u r i t e m s i . e . , a p a i r o f c o o r d i n a t e v a l u e s a n d a p a i r o f

    c o o r d i n a t e v a l u e s . T h u s , i n e e c t , w e h a v e c o n s t r u c t e d a m a p p i n g f r o m a t w o - d i m e n s i o n a l

    O f c o u r s e , t h e r e a r e o t h e r m a p p i n g s b u t t h e y h a v e s i m i l a r d r a w b a c k s . W e s h a l l u s e t h i s e x a m p l e i n t h e

    r e s t o f t h i s s e c t i o n .

  • 8/9/2019 Issues in Spatial Database and GIS

    45/66

    s p a c e i . e . , t h e s p a c e f r o m w h i c h t h e l i n e s a r e d r a w n t o a f o u r - d i m e n s i o n a l s p a c e i . e . , t h e

    s p a c e c o n t a i n i n g t h e r e p r e s e n t a t i v e p o i n t c o r r e s p o n d i n g t o t h e l i n e .

    T h i s m a p p i n g i s n e f o r s t o r a g e p u r p o s e s a n d f o r q u e r i e s t h a t o n l y i n v o l v e t h e p o i n t s

    t h a t c o m p r i s e t h e l i n e s e g m e n t s i n c l u d i n g t h e i r e n d p o i n t s . F o r e x a m p l e , n d i n g a l l t h e

    l i n e s e g m e n t s t h a t i n t e r s e c t a g i v e n p o i n t o r s e t o f p o i n t s o r a g i v e n l i n e s e g m e n t . H o w e v e r ,

    i t i s n o t g o o d f o r q u e r i e s t h a t i n v o l v e p o i n t s o r s e t s o f p o i n t s t h a t a r e n o t p a r t o f t h e l i n e

    s e g m e n t s a s t h e y a r e n o t t r a n s f o r m e d t o t h e h i g h e r d i m e n s i o n a l s p a c e b y t h e m a p p i n g .

    A n s w e r i n g s u c h a q u e r y i n v o l v e s p e r f o r m i n g a s e a r c h i n t h e s p a c e f r o m w h i c h t h e l i n e s a r e

    d r a w n r a t h e r t h a n i n t h e s p a c e i n t o w h i c h t h e y a r e m a p p e d .

    A s a m o r e c o n c r e t e e x a m p l e o f t h e s h o r t c o m i n g o f t h e m a p p i n g a p p r o a c h s u p p o s e t h a t

    w e w a n t t o d e t e c t i f t w o l i n e s a r e n e a r e a c h o t h e r , o r , a l t e r n a t i v e l y , t o n d t h e n e a r e s t l i n e t o

    a g i v e n p o i n t o r l i n e . T h i s i s d i c u l t t o d o i n t h e f o u r - d i m e n s i o n a l s p a c e s i n c e p r o x i m i t y i n

    t h e t w o - d i m e n s i o n a l s p a c e f r o m w h i c h t h e l i n e s a r e d r a w n i s n o t n e c e s s a r i l y p r e s e r v e d i n t h e

    f o u r - d i m e n s i o n a l s p a c e i n t o w h i c h t h e l i n e s a r e m a p p e d . I n o t h e r w o r d s , a l t h o u g h t h e t w o

    l i n e s m a y b e v e r y c l o s e t o e a c h o t h e r , t h e E u c l i d e a n d i s t a n c e b e t w e e n t h e i r r e p r e s e n t a t i v e

    p o i n t s m a y b e q u i t e l a r g e .

    T h u s w e n e e d d i e r e n t r e p r e s e n t a t i o n s f o r s p a t i a l d a t a . O n e w a y t o o v e r c o m e t h e s e

    p r o b l e m s i s t o u s e d a t a s t r u c t u r e s t h a t a r e b a s e d o n s p a t i a l o c c u p a n c y . S p a t i a l o c c u p a n c y

    m e t h o d s d e c o m p o s e t h e s p a c e f r o m w h i c h t h e d a t a i s d r a w n e . g . , t h e t w o - d i m e n s i o n a l

    s p a c e c o n t a i n i n g t h e l i n e s i n t o r e g i o n s c a l l e d b u c k e t s . T h e y a r e a l s o c o m m o n l y k n o w n a s

    b u c k e t i n g m e t h o d s . T r a d i t i o n a l l y , b u c k e t i n g m e t h o d s s u c h a s t h e g r i d l e N i e v e r g e l t e t a l .

    1 9 8 4 , b a n g l e F r e e s t o n 1 9 8 7 , t r e e s H e n r i c h e t a l . 1 9 8 9 , b u d d y t r e e s S e e g e r a n d

    K r i e g e l 1 9 9 0 , e t c . h a v e a l w a y s b e e n a p p l i e d t o t h e t r a n s f o r m e d d a t a i . e . , t h e r e p r e s e n t a t i v e

    p o i n t s . I n c o n t r a s t , w e a r e a p p l y i n g t h e b u c k e t i n g m e t h o d s t o t h e s p a c e f r o m w h i c h t h e

    d a t a i s d r a w n i . e . , t w o - d i m e n s i o n s i n t h e c a s e o f a c o l l e c t i o n o f l i n e s e g m e n t s .

    T h e r e a r e f o u r p r i n c i p a l a p p r o a c h e s t o d e c o m p o s i n g t h e s p a c e f r o m w h i c h t h e d a t a

    i s d r a w n . O n e a p p r o a c h b u c k e t s t h e d a t a b a s e d o n t h e c o n c e p t o f a m i n i m u m b o u n d i n g

    o r e n c l o s i n g r e c t a n g l e . I n t h i s c a s e , o b j e c t s a r e g r o u p e d h o p e f u l l y b y p r o x i m i t y i n t o

    h i e r a r c h i e s , a n d t h e n s t o r e d i n a n o t h e r s t r u c t u r e s u c h a s a - t r e e C o m e r 1 9 7 9 . T h e - t r e e

    e . g . , B e c k m a n n e t a l . 1 9 9 0 ; G u t t m a n 1 9 8 4 i s a n e x a m p l e o f t h i s a p p r o a c h .

    - t r e e a n d i t s v a r i a n t s a r e d e s i g n e d t o o r g a n i z e a c o l l e c t i o n o f a r b i t r a r y s p a t i a l

    o b j e c t s m o s t n o t a b l y t w o - d i m e n s i o n a l r e c t a n g l e s b y r e p r e s e n t i n g t h e m a s - d i m e n s i o n a l

    r e c t a n g l e s . E a c h n o d e i n t h e t r e e c o r r e s p o n d s t o t h e s m a l l e s t - d i m e n s i o n a l r e c t a n g l e t h a t

    e n c l o s e s i t s s o n n o d e s . L e a f n o d e s c o n t a i n p o i n t e r s t o t h e a c t u a l o b j e c t s i n t h e d a t a b a s e ,

    i n s t e a d o f s o n s . T h e o b j e c t s a r e r e p r e s e n t e d b y t h e s m a l l e s t a l i g n e d r e c t a n g l e c o n t a i n i n g

    t h e m .

    O f t e n t h e n o d e s c o r r e s p o n d t o d i s k p a g e s a n d , t h u s , t h e p a r a m e t e r s d e n i n g t h e t r e e

    a r e c h o s e n s o t h a t a s m a l l n u m b e r o f n o d e s i s v i s i t e d d u r i n g a s p a t i a l q u e r y . N o t e t h a t t h e

    b o u n d i n g r e c t a n g l e s c o r r e s p o n d i n g t o d i e r e n t n o d e s m a y o v e r l a p . A l s o , a n o b j e c t m a y b e

    s p a t i a l l y c o n t a i n e d i n s e v e r a l n o d e s , y e t i t i s o n l y a s s o c i a t e d w i t h o n e n o d e . T h i s m e a n s

    t h a t a s p a t i a l q u e r y m a y o f t e n r e q u i r e s e v e r a l n o d e s t o b e v i s i t e d b e f o r e a s c e r t a i n i n g t h e

    p r e s e n c e o r a b s e n c e o f a p a r t i c u l a r o b j e c t .

    T h e b a s i c r u l e s f o r t h e f o r m a t i o n o f a n - t r e e a r e v e r y s i m i l a r t o t h o s e f o r a - t r e e .

    A l l l e a f n o d e s a p p e a r a t t h e s a m e l e v e l . E a c h e n t r y i n a l e a f n o d e i s a 2 - t u p l e o f t h e f o r m

  • 8/9/2019 Issues in Spatial Database and GIS

    46/66

    s u c h t h a t i s t h e s m a l l e s t r e c t a n g l e t h a t s p a t i a l l y c o n t a i n s o b j e c t . E a c h e n t r y

    i n a n o n - l e a f n o d e i s a 2 - t u p l e o f t h e f o r m s u c h t h a t i s t h e s m a l l e s t r e c t a n g l e t h a t

    s p a t i a l l y c o n t a i n s t h e r e c t a n g l e s i n t h e c h i l d n o d e p o i n t e d a t b y - t r e e o f o r d e r

    m e a n s t h a t e a c h n o d e i n t h e t r e e , w i t h t h e e x c e p t i o n o f t h e r o o t , c o n t a i n s b e t w e e n

    e n t r i e s . T h e r o o t n o d e h a s a t l e a s t t w o e n t r i e s u n l e s s i t i s a l e a f n o d e .

    h

    a b

    e

    fi

    c

    d

    g

    F i g u r e 1 : E x a m p l e c o l l e c t i o n o f l i n e s e g m e n t s e m b e d d e d i n a 4 4 g r i d .

    F o r e x a m p l e , c o n s i d e r t h e c o l l e c t i o n o f l i n e s e g m e n t s g i v e n i n F i g u r e 1 s h o w n e m b e d d e d

    i n a 4 4 g r i d . L e t = 3 a n d = 2 . O n e p o s s i b l e - t r e e f o r t h i s c o l l e c t i o n i s g i v e n i n

    F i g u r e 2 a . F i g u r e 2 b s h o w s t h e s p a t i a l e x t e n t o f t h e b o u n d i n g r e c t a n g l e s o f t h e n o d e s i n

    F i g u r e 2 a , w i t h b r o k e n l i n e s d e n o t i n g t h e r e c t a n g l e s c o r r e s p o n d i n g t o t h e s u b t r e e s r o o t e d

    a t t h e n o n - l e a f n o d e s . N o t e t h a t t h e - t r e e i s n o t u n i q u e . I t s s t r u c t u r e d e p e n d s h e a v i l y

    o n t h e o r d e r i n w h i c h t h e i n d i v i d u a l l i n e s e g m e n t s w e r e i n s e r t e d i n t o a n d p o s s i b l y d e l e t e d

    f r o m t h e t r e e .

    R3R1

    R4

    R5

    R6R2

    R1 R2

    R3 R4 R5 R6

    a b c i e fg hd

    a b

    c

    d

    e

    f

    gh

    i

    Q

    (a) (b)

    F i g u r e 2 : a R - t r e e f o r t h e c o l l e c t i o n o f l i n e s e g m e n t s i n F i g u r e 1 , a n d b t h e s p a t i a l

    e x t e n t s o f t h e b o u n d i n g r e c t a n g l e s .

    T h e d r a w b a c k o f t h e s e m e t h o d s i s t h a t t h e y d o n o t r e s u l t i n a d i s j o i n t d e c o m p o s i t i o n o f

    s p a c e . T h e p r o b l e m i s t h a t a n o b j e c t i s o n l y a s s o c i a t e d w i t h o n e b o u n d i n g r e c t a n g l e e . g . ,

    l i n e s e g m e n t i n F i g u r e 2 i s a s s o c i a t e d w i t h r e c t a n g l e , y e t i t p a s s e s t h r o u g h

    . I n t h e w o r s t c a s e , t h i s m e a n s t h a t w h e n w e w i s h t o d e t e r m i n e w h i c h o b j e c t i s

    a s s o c i a t e d w i t h a p a r t i c u l a r p o i n t e . g . , t h e c o n t a i n i n g r e c t a n g l e i n a r e c t a n g l e d a t a b a s e ,

    o r a n i n t e r s e c t i n g l i n e i n a l i n e s e g m e n t d a t a b a s e i n t h e t w o - d i m e n s i o n a l s p a c e f r o m w h i c h

    t h e o b j e c t s a r e d r a w n , w e m a y h a v e t o s e a r c h t h e e n t i r e d a t a b a s e .

    F o r e x a m p l e , s u p p o s e w e w i s h t o d e t e r m i n e t h e i d e n t i t y o f t h e l i n e s e g m e n t i n t h e

    c o l l e c t i o n o f l i n e s e g m e n t s g i v e n i n F i g u r e 2 t h a t p a s s e s t h r o u g h p o i n t . S i n c e c a n b e i n

    e i t h e r o f , w e m u s t s e a r c h b o t h o f t h e i r s u b t r e e s . S e a r c h i n g r s t , w e n d t h a t

    c o u l d o n l y b e c o n t a i n e d i n . S e a r c h i n g d o e s n o t l e a d t o t h e l i n e s e g m e n t t h a t c o n t a i n s

    e v e n t h o u g h i s i n a p o r t i o n o f b o u n d i n g r e c t a n g l e t h a t i s i n . T h u s , w e m u s t s e a r c h

  • 8/9/2019 Issues in Spatial Database and GIS

    47/66

    a n d w e n d t h a t c a n o n l y b e c o n t a i n e d i n . S e a r c h i n g r e s u l t s i n l o c a t i n g , t h e

    d e s i r e d l i n e s e g m e n t .

    T h e o t h e r a p p r o a c h e s a r e b a s e d o n a d e c o m p o s i t i o n o f s p a c e i n t o d i s j o i n t c e l l s , w h i c h

    a r e m a p p e d i n t o b u c k e t s . T h e i r c o m m o n p r o p e r t y i s t h a t t h e o b j e c t s a r e d e c o m p o s e d i n t o

    d i s j o i n t s u b o b j e c t s s u c h t h a t e a c h o f t h e s u b o b j e c t s i s a s s o c i a t e d w i t h a d i e r e n t c e l l . T h e y

    d i e r i n t h e d e g r e e o f r e g u l a r i t y i m p o s e d b y t h e i r u n d e r l y i n g d e c o m p o s i t i o n r u l e s a n d b y

    t h e w a y i n w h i c h t h e c e l l s a r e a g g r e g a t e d . T h e p r i c e p a i d f o r t h e d i s j o i n t n e s s i s t h a t i n

    o r d e r t o d e t e r m i n e t h e a r e a c o v e r e d b y a p a r t i c u l a r o b j e c t , w e h a v e t o r e t r i e v e a l l t h e c e l l s

    t h a t i t o c c u p i e s . T h i s p r i c e i s a l s o p a i d w h e n w e w a n t t o d e l e t e a n o b j e c t . F o r t u n a t e l y ,

    d e l e t i o n i s n o t s o c o m m o n i n t h e s e d a t a b a s e s . A r e l a t e d d r a w b a c k i s t h a t w h e n w e w i s h

    t o d e t e r m i n e a l l t h e o b j e c t s t h a t o c c u r i n a p a r t i c u l a r r e g i o n w e o f t e n r e t r i e v e m a n y o f t h e

    o b j e c t s m o r e t h a n o n c e . T h i s i s p a r t i c u l a r l y p r o b l e m a t i c w h e n t h e r e s u l t o f t h e o p e r a t i o n

    s e r v e s a s i n p u t t o a n o t h e r o p e r a t i o n v i a c o m p o s i t i o n o f f u n c t i o n s . F o r e x a m p l e , s u p p o s e w e

    w i s h t o c o m p u t e t h e p e r i m e t e r o f a l l t h e o b j e c t s i n a g i v e n r e g i o n . C l e a r l y , e a c h o b j e c t ' s

    p e r i m e t e r s h o u l d o n l y b e c o m p u t e d o n c e . E l i m i n a t i n g t h e d u p l i c a t e s i s a s e r i o u s i s s u e

    s e e A r e f a n d S a m e t 1 9 9 2 f o r a d i s c u s s i o n o f h o w t o d e a l w i t h t h i s p r o b l e m i n a d a t a b a s e

    o f l i n e s e g m e n t s .

    T h e r s t m e t h o d b a s e d o n d i s j o i n t n e s s p a r t i t i o n s t h e o b j e c t s i n t o a r b i t r a r y d i s j o i n t

    s u b o b j e c t s a n d t h e n g r o u p s t h e s u b o b j e c t s i n a n o t h e r s t r u c t u r e s u c h a s a - t r e e . T h e

    p a r t i t i o n a n d t h e s u b s e q u e n t g r o u p i n g s a r e s u c h t h a t t h e b o u n d i n g r e c t a n g l e s a r e d i s j o i n t

    a t e a c h l e v e l o f t h e s t r u c t u r e . T h e - t r e e S e l l i s e t a l . 1 9 8 7 a n d t h e c e l l t r e e G u n t h e r

    1 9 8 8 a r e e x a m p l e s o f t h i s a p p r o a c h . T h e y d i e r i n t h e d a t a w i t h w h i c h t h e y d e a l . T h e

    - t r e e d e a l s w i t h c o l l e c t i o n s o f o b j e c t s t h a t a r e b o u n d e d b y r e c t a n g l e s , w h i l e t h e c e l l t r e e

    d e a l s w i t h c o n v e x p o l y h e d r a .

    - t r e e i s a n e x t e n s i o n o f t h e k - d - - t r e e R o b i n s o n 1 9 8 1 . T h e - t r e e i s m o t i v a t e d

    b y a d e s i r e t o a v o i d o v e r l a p a m o n g t h e b o u n d i n g r e c t a n g l e s . E a c h o b j e c t i s a s s o c i a t e d w i t h

    a l l t h e b o u n d i n g r e c t a n g l e s t h a t i t i n t e r s e c t s . A l l b o u n d i n g r e c t a n g l e s i n t h e t r e e w i t h t h e

    e x c e p t i o n o f t h e b o u n d i n g r e c t a n g l e s f o r t h e o b j e c t s a t t h e l e a f n o d e s a r e n o n - o v e r l a p p i n g

    . T h e r e s u l t i s t h a t t h e r e m a y b e s e v e r a l p a t h s s t a r t i n g a t t h e r o o t t o t h e s a m e o b j e c t .

    T h i s m a y l e a d t o a n i n c r e a s e i n t h e h e i g h t o f t h e t r e e . H o w e v e r , r e t r i e v a l t i m e i s s p e d u p .

    R5

    R1

    R3

    R2

    R6R4

    R1 R2

    R3 R4 R5 R6

    h ic

    ab

    c

    d

    e

    f

    gh

    i

    g hd e ia b f ic

    (a) (b)

    F i g u r e 3 : a R - t r e e f o r t h e c o l l e c t i o n o f l i n e s e g m e n t s i n F i g u r e 1 a n d b t h e s p a t i a l

    e x t e n t s o f t h e b o u n d i n g r e c t a n g l e s .

    F i g u r e 3 i s a n e x a m p l e o f o n e p o s s i b l e - t r e e f o r t h e c o l l e c t i o n o f l i n e s e g m e n t s i n

    F r o m a t h e o r e t i c a l v i e w p o i n t , t h e b o u n d i n g r e c t a n g l e s f o r t h e o b j e c t s a t t h e l e a f n o d e s s h o u l d a l s o b e

    d i s j o i n t . H o w e v e r , t h i s m a y b e i m p o s s i b l e e . g . , w h e n t h e o b j e c t s a r e l i n e s e g m e n t s w h e r e m a n y l i n e s e g m e n t s

    i n t e r s e c t a t a p o i n t .

  • 8/9/2019 Issues in Spatial Database and GIS

    48/66

    F i g u r e 1 . T h i s p a r t i c u l a r t r e e i s o f o r d e r 2 , 3 a l t h o u g h i n g e n e r a l i t i s n o t p o s s i b l e t o

    g u a r a n t e e t h a t a l l n o d e s w i l l a l w a y s h a v e a m i n i m u m o f 2 e n t r i e s . I n p a r t i c u l a r , t h e e x p e c t e d

    - t r e e p e r f o r m a n c e g u a r a n t e e s a r e n o t v a l i d i . e . , p a g e s a r e n o t g u a r a n t e e d t o b e f u l l

    u n l e s s w e a r e w i l l i n g t o p e r f o r m v e r y c o m p l i c a t e d r e c o r d i n s e r t i o n a n d d e l e t i o n p r o c e d u r e s .

    N o t i c e t h a t l i n e s e g m e n t s a p p e a r i n t w o d i e r e n t n o d e s , w h i l e l i n e s e g m e n t

    a p p e a r s i n t h r e e d i e r e n t n o d e s . O f c o u r s e , o t h e r v a r i a n t s a r e p o s s i b l e s i n c e t h e - t r e e i s

    n o t u n i q u e .

    M e t h o d s s u c h a s t h e - t r e e a n d t h e c e l l t r e e a s w e l l a s t h e - t r e e B e c k m a n n e t a l .

    1 9 9 0 h a v e t h e d r a w b a c k t h a t t h e d e c o m p o s i t i o n i s d a t a - d e p e n d e n t . T h i s m e a n s t h a t i t i s

    d i c u l t t o p e r f o r m t a s k s t h a t r e q u i r e c o m p o s i t i o n o f d i e r e n t o p e r a t i o n s a n d d a t a s e t s e . g . ,

    s e t - t h e o r e t i c o p e r a t i o n s s u c h a s o v e r l a y . I n c o n t r a s t , t h e r e m a i n i n g t w o m e t h o d s , w h i l e

    a l s o y i e l d i n g a d i s j o i n t d e c o m p o s i t i o n , h a v e a g r e a t e r d e g r e e o f d a t a - i n d e p e n d e n c e . T h e y

    a r e b a s e d o n a r e g u l a r d e c o m p o s i t i o n . T h e s p a c e c a n b e d e c o m p o s e d e i t h e r i n t o b l o c k s

    o f u n i f o r m s i z e e . g . , t h e u n i f o r m g r i d F r a n k l i n 1 9 8 4 o r a d a p t t h e d e c o m p o s i t i o n t o t h e

    d i s t r i b u t i o n o f t h e d a t a e . g . , a q u a d t r e e - b a s e d a p p r o a c h s u c h a s S a m e t a n d W e b b e r 1 9 8 5 .

    I n t h e f o r m e r c a s e , a l l t h e b l o c k s a r e o f t h e s a m e s i z e e . g . , t h e 4 4 g r i d i n F i g u r e 1 .

    I n t h e l a t t e r c a s e , t h e w i d t h s o f t h e b l o c k s a r e r e s t r i c t e d t o b e p o w e r s o f t w o , a n d t h e i r

    p o s i t i o n s a r e a l s o r e s t r i c t e d .

    T h e u n i f o r m g r i d i s i d e a l f o r u n i f o r m l y d i s t r i b u t e d d a t a , w h i l e q u a d t r e e - b a s e d a p -

    p r o a c h e s a r e s u i t e d f o r a r b i t r a r i l y d i s t r i b u t e d d a t a . I n t h e c a s e o f u n i f o r m l y d i s t r i b u t e d

    d a t a , q u a d t r e e - b a s e d a p p r o a c h e s d e g e n e r a t e t o a u n i f o r m g r i d , a l b e i t t h e y h a v e a h i g h e r

    o v e r h e a d . B o t h t h e u n i f o r m g r i d a n d t h e q u a d t r e e - b a s e d a p p r o a c h e s l e n d t h e m s e l v e s t o

    s e t - t h e o r e t i c o p e r a t i o n s a n d t h u s t h e y a r e i d e a l f o r t a s k s w h i c h r e q u i r e t h e c o m p o s i t i o n

    o f d i e r e n t o p e r a t i o n s a n d d a t a s e t s . I n g e n e r a l , s i n c e s p a t i a l d a t a i s n o t u s u a l l y u n i -

    f o r m l y d i s t r i b u t e d , t h e q u a d t r e e - b a s e d r e g u l a r d e c o m p o s i t i o n a p p r o a c h i s m o r e e x i b l e .

    T h e d r a w b a c k o f q u a d t r e e - l i k e m e t h o d s i s t h e i r s e n s i t i v i t y t o p o s i t i o n i n g i n t h e s e n s e t h a t

    t h e p l a c e m e n t o f t h e o b j e c t s r e l a t i v e t o t h e d e c o m p o s i t i o n l i n e s o f t h e s p a c e i n w h i c h t h e y

    a r e e m b e d d e d e e c t s t h e i r s t o r a g e c o s t s a n d t h e a m o u n t o f d e c o m p o s i t i o n t h a t t a k e s p l a c e .

    T h i s i s o v e r c o m e t o a l a r g e e x t e n t b y u s i n g a b u c k e t i n g a d a p t a t i o n t h a t d e c o m p o s e s a b l o c k

    o n l y i f i t c o n t a i n s m o r e t h a n o b j e c t s .

    A l l o f t h e s p a t i a l o c c u p a n c y m e t h o d s d i s c u s s e d a b o v e a r e c h a r a c t e r i z e d a s e m p l o y i n g

    s p a t i a l i n d e x i n g b e c a u s e w i t h e a c h b l o c k t h e o n l y i n f o r m a t i o n t h a t i s s t o r e d i s w h e t h e r o r

    n o t t h e b l o c k i s o c c u p i e d b y t h e o b j e c t o r p a r t o f t h e o b j e c t . T h i s i n f o r m a t i o n i s u s u a l l y i n

    t h e f o r m o f a p o i n t e r t o a d e s c r i p t o r o f t h e o b j e c t . F o r e x a m p l e , i n t h e c a s e o f a c o l l e c t i o n

    o f l i n e s e g m e n t s i n t h e u n i f o r m g r i d o f F i g u r e 1 , t h e s h a d e d b l o c k o n l y r e c o r d s t h e f a c t t h a t

    a l i n e s e g m e n t c r o s s e s i t o r p a s s e s t h r o u g h i t . T h e p a r t o f t h e l i n e s e g m e n t t h a t p a s s e s

    t h r o u g h t h e b l o c k o r t e r m i n a t e s w i t h i n i t i s t e r m e d a q - e d g e . E a c h q - e d g e i n t h e b l o c k

    i s r e p r e s e n t e d b y a p o i n t e r t o a r e c o r d c o n t a i n i n g t h e e n d p o i n t s o f t h e l i n e s e g m e n t o f

    w h i c h t h e q - e d g e i s a p a r t N e l s o n a n d S a m e t 1 9 8 6 . T h i s p o i n t e r i s r e a l l y n o t h i n g m o r e

    t h a n a s p a t i a l i n d e x a n d h e n c e t h e u s e o f t h i s t e r m t o c h a r a c t e r i z e t h i s a p p r o a c h . T h u s n o

    i n f o r m a t i o n i s a s s o c i a t e d w i t h t h e s h a d e d b l o c k a s t o w h a t p a r t o f t h e l i n e i . e . , q - e d g e

    c r o s s e s i t . T h i s i n f o r m a t i o n c a n b e o b t a i n e d b y c l i p p i n g F o l e y e t a l . 1 9 9 0 t h e o r i g i n a l l i n e

    s e g m e n t t o t h e b l o c k . T h i s i s i m p o r t a n t f o r o f t e n t h e p r e c i s i o n n e c e s s a r y t o c o m p u t e t h e s e

    i n t e r s e c t i o n p o i n t s i s n o t a v a i l a b l e .

  • 8/9/2019 Issues in Spatial Database and GIS

    49/66

    3 R e g i o n D a t a

    A r e g i o n c a n b e r e p r e s e n t e d e i t h e r b y i t s i n t e r i o r o r b y i t s b o u n d a r y . I n t h i s s e c t i o n w e

    f o c u s o n t h e r e p r e s e n t a t i o n s o f r e g i o n s b y t h e i r i n t e r i o r , w h i l e t h e u s e o f a b o u n d a r y i s

    d i s c u s s e d i n S e c t i o n 6 i n t h e c o n t e x t o f c o l l e c t i o n s o f l i n e s e g m e n t s a s f o u n d , f o r e x a m p l e , i n

    p o l y g o n a l m a p s . T h e m o s t c o m m o n r e g i o n r e p r e s e n t a t i o n i s t h e i m a g e a r r a y . I n t h i s c a s e ,

    w e h a v e a c o l l e c t i o n o f p i c t u r e e l e m e n t s t e r m e d p i x e l s . S i n c e t h e n u m b e r o f e l e m e n t s i n

    t h e a r r a y c a n b e q u i t e l a r g e , t h e r e i s i n t e r e s t i n r e d u c i n g i t s s i z e b y a g g r e g a t i n g s i m i l a r i . e . ,

    h o m o g e n e o u s o r e q u a l - v a l u e d p i x e l s . T h e r e a r e t w o b a s i c a p p r o a c h e s . T h e r s t a p p r o a c h

    b r e a k s u p t h e a r r a y i n t o 1 b l o c k s R u t o v i t z 1 9 6 8 . T h i s i s a r o w r e p r e s e n t a t i o n a n d

    i s k n o w n a s a r u n l e n g t h c o d e . A m o r e g e n e r a l a p p r o a c h t r e a t s t h e r e g i o n a s a u n i o n o f

    m a x i m a l s q u a r e b l o c k s o r b l o c k s o f a n y o t h e r d e s i r e d s h a p e t h a t m a y p o s s i b l y o v e r l a p .

    U s u a l l y t h e b l o c k s a r e s p e c i e d b y t h e i r c e n t e r s a n d r a d i i . T h i s r e p r e s e n t a t i o n i s c a l l e d t h e

    m e d i a l a x i s t r a n s f o r m a t i o n M A T B l u m 1 9 6 7 .

    W h e n t h e m a x i m a l b l o c k s a r e r e q u i r e d t o b e d i s j o i n t , t o h a v e s t a n d a r d s i z e s s q u a r e s

    w h o s e s i d e s a r e p o w e r s o f t w o , a n d t o b e a t s t a n d a r d l o c a t i o n s a s a r e s u l t o f a h a l v i n g

    p r o c e s s i n b o t h t h e d i r e c t i o n s , t h e r e s u l t i s k n o w n a s a r e g i o n q u a d t r e e K l i n g e r

    1 9 7 1 . I t i s b a s e d o n t h e s u c c e s s i v e s u b d i v i s i o n o f t h e i m a g e a r r a y i n t o f o u r e q u a l - s i z e

    q u a d r a n t s . I f t h e a r r a y d o e s n o t c o n s i s t e n t i r e l y o f 1 s o r e n t i r e l y o f 0 s i . e . , t h e r e g i o n d o e s

    n o t c o v e r t h e e n t i r e a r r a y , i t i s t h e n s u b d i v i d e d i n t o q u a d r a n t s , s u b q u a d r a n t s , e t c . , u n t i l

    b l o c k s a r e o b t a i n e d p o s s i b l y 1 1 b l o c k s t h a t c o n s i s t e n t i r e l y o f 1 s o r e n t i r e l y o f 0 s . T h u s ,

    t h e r e g i o n q u a d t r e e c a n b e c h a r a c t e r i z e d a s a v a r i a b l e r e s o l u t i o n d a t a s t r u c t u r e .

    A s a n e x a m p l e o f t h e r e g i o n q u a d t r e e , c o n s i d e r t h e r e g i o n s h o w n i n F i g u r e 4 a w h i c h i s

    r e p r e s e n t e d b y t h e 2 b i n a r y a r r a y i n F i g u r e 4 b . O b s e r v e t h a t t h e 1 s c o r r e s p o n d t o

    p i x e l s t h a t a r e i n t h e r e g i o n a n d t h e 0 s c o r r e s p o n d t o p i x e l s t h a t a r e o u t s i d e t h e r e g i o n .

    T h e r e s u l t i n g b l o c k s f o r t h e a r r a y o f F i g u r e 4 b a r e s h o w n i n F i g u r e 4 c . T h i s p r o c e s s i s

    r e p r e s e n t e d b y a t r e e o f d e g r e e 4 .

    0 0 0 0 00 0 0

    0

    0

    0

    0

    0

    0

    0

    0 0 0 0 0 0 0

    0

    0

    0

    0

    0

    0

    0

    0

    0

    0

    0

    0 0 0

    00

    1

    1

    1 1

    1

    1

    1

    1

    1

    1

    1

    1

    1

    1

    1

    1

    1

    1 1

    1

    1

    1 1

    1

    1

    11

    2 3

    4 5

    6 7 8

    9 1013

    11 12

    14

    15 16

    17 1819

    A

    NWNE SW

    SE

    1

    2 3 4 5 6 11 12 13 14 19

    7 8 9 10 15 16 17 18

    B C

    D F

    E

    (a) (b) (c)

    (d)

    F i g u r e 4 : a S a m p l e r e g i o n , b i t s b i n a r y a r r a y r e p r e s e n t a t i o n , c i t s m a x i m a l b l o c k s w i t h

    t h e b l o c k s i n t h e r e g i o n b e i n g s h a d e d , a n d d t h e c o r r e s p o n d i n g q u a d t r e e .

    I n t h e t r e e r e p r e s e n t a t i o n , t h e r o o t n o d e c o r r e s p o n d s t o t h e e n t i r e a r r a y . E a c h s o n o f

    a n o d e r e p r e s e n t s a q u a d r a n t l a b e l e d i n o r d e r o f t h e r e g i o n r e p r e s e n t e d

    b y t h a t n o d e . T h e l e a f n o d e s o f t h e t r e e c o r r e s p o n d t o t h o s e b l o c k s f o r w h i c h n o f u r t h e r

    s u b d i v i s i o n i s n e c e s s a r y . A l e a f n o d e i s s a i d t o b e b l a c k w h i t e , d e p e n d i n g o n w h e t h e r

    i t s c o r r e s p o n d i n g b l o c k i s e n t i r e l y i n s i d e o r e n t i r e l y o u t s i d e o f t h e r e p r e s e n t e d r e g i o n . A l l

    n o n - l e a f n o d e s a r e s a i d t o b e g r a y . T h e q u a d t r e e r e p r e s e n t a t i o n f o r F i g u r e 4 c i s s h o w n i n

  • 8/9/2019 Issues in Spatial Database and GIS

    50/66

    F i g u r e 4 d . O f c o u r s e , q u a d t r e e s c a n a l s o b e u s e d t o r e p r e s e n t n o n - b i n a r y i m a g e s . I n t h i s

    c a s e , t h e s a m e m e r g i n g c r i t e r i a i s a p p l i e d t o e a c h c o l o r . F o r e x a m p l e , i n t h e c a s e o f a l a n d u s e

    m a p , s i m p l y m e r g e a l l w h e a t g r o w i n g r e g i o n s , a n d l i k e w i s e f o r c o r n , r i c e , e t c . S a m e t e t a l .

    1 9 8 4 .

    T h e t e r m q u a d t r e e i s o f t e n u s e d i n a m o r e g e n e r a l s e n s e s t o d e s c r i b e a c l a s s o f h i e r a r c h i c a l

    d a t a s t r u c t u r e s w h o s e c o m m o n p r o p e r t y i s t h a t t h e y a r e b a s e d o n t h e p r i n c i p l e o f r e c u r s i v e

    d e c o m p o s i t i o n o f s p a c e . T h e y c a n b e d i e r e n t i a t e d o n t h e f o l l o w i n g b a s e s :

    1 . t h e t y p e o f d a t a t h a t t h e y a r e u s e d t o r e p r e s e n t ,

    2 . t h e p r i n c i p l e g u i d i n g t h e d e c o m p o s i t i o n p r o c e s s , a n d

    3 . t h e r e s o l u t i o n v a r i a b l e o r n o t .

    C u r r e n t l y , t h e y a r e u s e d f o r p o i n t s , r e c t a n g l e s , r e g i o n s , c u r v e s , s u r f a c e s , a n d v o l u m e s s e e

    t h e r e m a i n i n g s e c t i o n s f o r f u r t h e r d e t a i l s o n t h e a d a p t a t i o n o f t h e q u a d t r e e t o t h e m . T h e

    d e c o m p o s i t i o n m a y b e i n t o e q u a l p a r t s o n e a c h l e v e l t e r m e d a r e g u l a r d e c o m p o s i t i o n , o r

    i t m a y b e g o v e r n e d b y t h e i n p u t . T h e r e s o l u t i o n o f t h e d e c o m p o s i t i o n i . e . , t h e n u m b e r

    o f t i m e s t h a t t h e d e c o m p o s i t i o n p r o c e s s i s a p p l i e d m a y b e x e d b e f o r e h a n d o r i t m a y b e

    g o v e r n e d b y p r o p e r t i e s o f t h e i n p u t d a t a .

    U n f o r t u n a t e l y , t h e t e r m q u a d t r e e h a s t a k e n o n m o r e t h a n o n e m e a n i n g . T h e r e g i o n

    q u a d t r e e , a s s h o w n a b o v e , i s a p a r t i t i o n o f s p a c e i n t o a s e t o f s q u a r e s w h o s e s i d e s a r e a l l

    a p o w e r o f t w o l o n g . A s i m i l a r p a r t i t i o n o f s p a c e i n t o r e c t a n g u l a r q u a d r a n t s i s t e r m e d a

    p o i n t q u a d t r e e F i n k e l a n d B e n t l e y 1 9 7 4 . I t i s a n a d a p t a t i o n o f t h e b i n a r y s e a r c h t r e e t o

    t w o d i m e n s i o n s w h i c h c a n b e e a s i l y e x t e n d e d t o a n a r b i t r a r y n u m b e r o f d i m e n s i o n s . I t

    i s p r i m a r i l y u s e d t o r e p r e s e n t m u l t i d i m e n s i o n a l p o i n t d a t a w h e r e t h e r e c t a n g u l a r r e g i o n s

    n e e d n o t b e s q u a r e . T h e q u a d t r e e i s a l s o o f t e n c o n f u s e d w i t h t h e p y r a m i d T a n i m o t o a n d

    P a v l i d i s 1 9 7 5 . T h e p y r a m i d i s a m u l t i r e s o l u t i o n r e p r e s e n t a t i o n w h i c h i s a n e x p o n e n t i a l l y

    t a p e r i n g s t a c k o f a r r a y s , e a c h o n e - q u a r t e r t h e s i z e o f t h e p r e v i o u s a r r a y . I n c o n t r a s t , t h e

    r e g i o n q u a d t r e e i s a v a r i a b l e r e s o l u t i o n d a t a s t r u c t u r e .

    T h e d i s t i n c t i o n b e t w e e n a q u a d t r e e a n d a p y r a m i d i s i m p o r t a n t i n t h e d o m a i n o f s p a t i a l

    d a t a b a s e s , a n d c a n b e e a s i l y s e e n b y c o n s i d e r i n g t h e t y p e s o f s p a t i a l q u e r i e s . T h e r e a r e

    t w o p r i n c i p a l t y p e s A r e f a n d S a m e t 1 9 9 0 . T h e r s t i s l o c a t i o n - b a s e d . I n t h i s c a s e , w e

    a r e s e a r c h i n g f o r t h e n a t u r e o f t h e f e a t u r e a s s o c i a t e d w i t h a p a r t i c u l a r l o c a t i o n o r i n i t s

    p r o x i m i t y . F o r e x a m p l e , w h a t i s t h e f e a t u r e a t l o c a t i o n X ? " , w h a t i s t h e n e a r e s t c i t y

    t o l o c a t i o n X ? " , o r w h a t i s t h e n e a r e s t r o a d t o l o c a t i o n X ? " T h e s e c o n d i s f e a t u r e - b a s e d .

    I n t h i s c a s e , w e a r e p r o b i n g f o r t h e p r e s e n c e o r a b s e n c e o f a f e a t u r e , a s w e l l a s s e e k i n g

    i t s a c t u a l l o c a t i o n . F o r e x a m p l e , d o e s w h e a t g r o w a n y w h e r e i n C a l i f o r n i a ? " , w h a t c r o p s

    g r o w i n C a l i f o r n i a ? " , o r w h e r e i s w h e a t g r o w n i n C a l i f o r n i a ? "

    L o c a t i o n - b a s e d q u e r i e s a r e e a s y t o a n s w e r w i t h a q u a d t r e e r e p r e s e n t a t i o n a s t h e y i n v o l v e

    d e s c e n d i n g t h e t r e e u n t i l n d i n g t h e o b j e c t . I f a n e a r e s t n e i g h b o r i s d e s i r e d , t h e n t h e s e a r c h

    i s c o n t i n u e d i n t h e n e i g h b o r h o o d o f t h e n o d e c o n t a i n i n g t h e o b j e c t . T h i s s e a r c h c a n a l s o

    b e a c h i e v e d b y u n w i n d i n g t h e p r o c e s s u s e d t o a c c e s s t h e n o d e c o n t a i n i n g t h e o b j e c t . O n

    t h e o t h e r h a n d , f e a t u r e - b a s e d q u e r i e s a r e m o r e d i c u l t . T h e p r o b l e m i s t h a t t h e r e i s n o

    i n d e x i n g b y f e a t u r e s . T h e i n d e x i n g i s o n l y b a s e d o n s p a t i a l o c c u p a n c y . T h e g o a l i s t o

    p r o c e s s t h e q u e r y w i t h o u t e x a m i n i n g e v e r y l o c a t i o n i n s p a c e . T h e p y r a m i d i s u s e f u l f o r

  • 8/9/2019 Issues in Spatial Database and GIS

    51/66

    s u c h q u e r i e s s i n c e t h e n o d e s t h a t a r e n o t a t t h e m a x i m u m l e v e l o f r e s o l u t i o n i . e . , a t t h e

    b o t t o m l e v e l c o n t a i n s u m m a r y i n f o r m a t i o n . T h u s w e c o u l d v i e w t h e s e n o d e s a s f e a t u r e

    v e c t o r s w h i c h i n d i c a t e w h e t h e r o r n o t a f e a t u r e i s p r e s e n t a t a h i g h e r l e v e l o f r e s o l u t i o n .

    T h e r e f o r e , b y e x a m i n i n g t h e r o o t o f t h e p y r a m i d i . e . , t h e n o d e t h a t r e p r e s e n t s t h e e n t i r e

    i m a g e w e c a n q u i c k l y t e l l i f a f e a t u r e i s p r e s e n t w i t h o u t h a v i n g t o e x a m i n e e v e r y l o c a t i o n .

    F o r e x a m p l e , c o n s i d e r t h e b l o c k d e c o m p o s i t i o n o f t h e n o n - b i n a r y i m a g e i n F i g u r e 5 a .

    I t s t r u n c a t e d p y r a m i d i s g i v e n i n F i g u r e 5 b . T h e v a l u e s o f a n o n l e a f n o d e i n t h e t r u n c a t e d

    p y r a m i d i n d i c a t e i f t h e f e a t u r e i s p r e s e n t i n t h e s u b t r e e s o f . I n t h e i n t e r e s t o f s a v i n g s p a c e ,

    t h e p y r a m i d i s n o t s h o w n i n i t s e n t i r e t y h e r e .

    A

    B

    C

    D

    E

    F

    {A,B,C,D,E,F}

    {B,C,F} {B,C,D,E}

    {A,B,C,D,E,F}

    {B,C,E} {A,B,C,E}

    (a) (b)

    F i g u r e 5 : a S a m p l e n o n - b i n a r y i m a g e , a n d b i t s c o r r e s p o n d i n g t r u n c a t e d p y r a m i d .

    Q u a d t r e e - l i k e d a t a s t r u c t u r e s c a n a l s o b e u s e d t o r e p r e s e n t i m a g e s i n t h r e e d i m e n s i o n s

    a n d h i g h e r . T h e o c t r e e H u n t e r 1 9 7 8 ; M e a g h e r 1 9 8 2 d a t a s t r u c t u r e i s t h e t h r e e - d i m e n s i o n a l

    a n a l o g o f t h e q u a d t r e e . I t i s c o n s t r u c t e d i n t h e f o l l o w i n g m a n n e r . W e s t a r t w i t h a n i m a g e

    i n t h e f o r m o f a c u b i c a l v o l u m e a n d r e c u r s i v e l y s u b d i v i d e i t i n t o e i g h t c o n g r u e n t d i s j o i n t

    c u b e s c a l l e d o c t a n t s u n t i l b l o c k s a r e o b t a i n e d o f a u n i f o r m c o l o r o r a p r e d e t e r m i n e d l e v e l

    o f d e c o m p o s i t i o n i s r e a c h e d . F i g u r e 6 a i s a n e x a m p l e o f a s i m p l e t h r e e - d i m e n s i o n a l o b j e c t

    w h o s e r a s t e r o c t r e e b l o c k d e c o m p o s i t i o n i s g i v e n i n F i g u r e 6 b a n d w h o s e t r e e r e p r e s e n t a t i o n

    i s g i v e n i n F i g u r e 6 c .

    1 2 3 4 13 14 15

    12111098765

    B

    A14 15

    49 10

    6

    1 2

    13

    1211

    5

    (a) (b) (c)

    F i g u r e 6 : a E x a m p l e t h r e e - d i m e n s i o n a l o b j e c t ; b i t s o c t r e e b l o c k d e c o m p o s i t i o n ; a n d c

    i t s t r e e r e p r e s e n t a t i o n .

    T h e q u a d t r e e i s p a r t i c u l a r l y u s e f u l f o r p e r f o r m i n g s e t o p e r a t i o n s a s t h e y f o r m t h e b a s i s

    o f m o s t c o m p l i c a t e d q u e r i e s . F o r e x a m p l e , t o n d t h e n a m e s o f t h e r o a d s t h a t p a s s t h r o u g h

    t h e U n i v e r s i t y o f M a r y l a n d r e g i o n , " w e w i l l n e e d t o i n t e r s e c t a r e g i o n m a p w i t h a l i n e m a p .

    F o r a b i n a r y i m a g e , s e t - t h e o r e t i c o p e r a t i o n s s u c h a s u n i o n a n d i n t e r s e c t i o n a r e q u i t e s i m p l e

    t o i m p l e m e n t H u n t e r a n d S t e i g l i t z 1 9 7 9 .

    I n p a r t i c u l a r , t h e i n t e r s e c t i o n o f t w o q u a d t r e e s y i e l d s a b l a c k n o d e o n l y w h e n t h e

    c o r r e s p o n d i n g r e g i o n s i n b o t h q u a d t r e e s a r e b l a c k . T h i s o p e r a t i o n i s p e r f o r m e d b y s i -

    m u l t a n e o u s l y t r a v e r s i n g t h r e e q u a d t r e e s . T h e r s t t w o t r e e s c o r r e s p o n d t o t h e t r e e s b