Spatial DB Flashcards
Spatial DB vs Image/Multimedia DB
Image/multimedia DB:
- are purely raster data with not structure to queries
- contain complex spatial objects
Spatial DB:
- contain raster data only as a means for visualizing the other data
- contains a large collection of relatively simple objects
3 types of structures in spatial DBs
point
line
region
what is ROSE Algebra
Robust Spatial Extension Algebra
The 2 spatial domains?
EXT = {line, region} GEO = {point, line, region}
3 ROSE operations to evaluate topological relationships
“inside” (geo x region) = bool (returns a bool)
“intersect” (ext1 x ext2) = bool
“adjacent” (region x region) = bool
4 ROSE operations returning atomic spatial data types
“intersection” (line x line) = point
“intersection” (region x region) = region
“plus, minus” (geo x geo) = geo
“countour” (region) = line
2 ROSE operations returning numbers
“dist” (geo1 x geo2) = real
“perimeter, area” (region) = real
2 ROSE operations on object sets
“sum” (set(obj) x (obj -> geo)) = geo
-for all objects in a set (ie. an object could be a city)
-choose a given spatial attribute of the object “(obj -> geo)” (ie. the ‘slums’ of the city is an attribute of the object that is a region)
-we then perform the geometric union of all these attributes to form a single geo
(Remember that the geometric union of two rays can form an angle. The union of two regions forms a region)
“closest” (set(obj) x (obj -> geo1) x geo2 = set(obj)
-returns the set of objects whose spatial attribute value is closest to some spatial reference value
3 types of spatial relationships
topological relationships
direction relationships
metric relationships
Examples topological relationships
adjacent
inside
disjoint
these are invariant under topological transformations such as translation, scaling, and rotation
Examples of direction relationships
above
below
north_of
Example of metric relationship
distance
8 Properties of B tree
‘m’ is the order of the tree
all leaf nodes are at the same level
if the root is not a leaf, it must have at least 2 children
All other internal nodes have at least m//2 children and at most m children
all internal nodes have at least (#children- 1) keys and at most m-1 Keys.
all leaf nodes have at least m//2 Keys and at most m-1 keys
all key values must be in ascending order
all keys point to data somewhere in the system
Differences in B+ tree from B tree
the keys that point to data somewhere in the system are all leaves in the bottom level
each key in an internal node will be the lower bound key of one of its child nodes
ex) (3,7)
left child = […,3)
middle child = [3,7)
right child = [7,…]
Notice how 3 and 7 are repeated in their children
all leaves are linked by pointers for rapid in order traversal
inserting a B/B+ tree
find node to add key
if node has room for key simply add it
if node does not have room split the node and send the middle value to the parent.
repeat the previous two steps for the parent if necessary