Title: Spatial Data Types
1 - Spatial Data Types
- and their
- Embedding in Query Languages (II)
2In-Class Presentation Part II
Padmavati Sridhar
- As Partial Course Requirement for
- Spatial Databases as a Foundation of
- Geographical Information Systems
- (CIS 6930,Fall 2004)
- Instructor Dr. Markus Schneider
-
3Objective
- To provide a detailed overview of the
- Modeling
- Design and
- Implementation
- approaches of Spatial data types and operations
- Emphasis Understanding the basic concepts
4Outline
- Introduction to Spatial Databases
- Spatial Modeling
- Data Models
- Modeling of Spatial Data Types (SDTs)
- Modeling of Spatial Operations
- Database Design and Query Examples
- Design
- Formal Definition Methods
- Implementation
- Data Structures for SDTs
- Algorithms for atomic SDT Operations
5Quick Recap
- Introduction to Spatial Databases
- Spatial Data and Querying
- User Classes
- SDBMS definition
- 3 tier Architecture
- Spatial Modeling
- Data Models Field and Object Based
- Modeling of Spatial Data Types (SDTs)
- Single Objects Fundamental Abstractions
Point, Line, Region - Spatially related Collections of Objects
Partitions and Networks - Modeling of Spatial Operations
- 3 Step Database Design
- Query Examples
- Design
- Formal Definition Methods
- Implementation
- Data Structures for SDTs
- Algorithms for atomic SDT Operations
6Introduction to Spatial Databases (Revised)
- What Is Spatial Data ?
- To extract information, data has to be processed
with respect to a Spatial frame of Reference (Eg
Latitude/Longitude ) - Data related to Space where Space can be
- Geographic Space
- Layout of a VLSI design
- Space representing the arrangement of chains of
protein molecules - Image Database Systems
- Include Analysis techniques to extract objects in
space from Images and are prepared to store,
manipulate and retrieve raster images as discrete
entities - Spatial Database System
- Is a Database system
- Offers SDTs in its model and Query Language
- Supports SDTs in its implementation, providing at
least Spatial Indexing and efficient algorithms
for Spatial Join
7Modeling Spatially Related Collections of Objects
Partition
Network
- Partition
- Set of Region Objects that are required to be
disjoint - Interest Adjacency (There exist pairs of Region
Objects with a Common boundary) - Use Thematic Maps
- Network
- Graph embedded into the Plane, consisting of
- Nodes A Set of Point Objects
- Edges A Set of Line Objects
- Use Map of Highways, Rivers
8Quick Recap
- Introduction to Spatial Databases
- Spatial Data and Querying
- User Classes
- SDBMS definition
- 3 tier Architecture
- Spatial Modeling
- Data Models Field and Object Based
- Modeling of Spatial Data Types (SDTs)
- Single Objects Fundamental Abstractions
Point, Line, Region - Spatially related Collections of Objects
Partitions and Networks - Modeling of Spatial Operations
- 3 Step Database Design
- Query Examples
- Design
- Formal Definition Methods
- Implementation
- Data Structures for SDTs
- Algorithms for atomic SDT Operations
9Conceptual Model Illustration
- ER Model
- 3 Entities Country, City, River
- 2 Relationships capital-of, originates-in
10Sample Data
11Spatial Query Types
- Simple SQL SELECT_FROM_WHERE examples
- Spatial analysis operations
- Unary operator Area
- Binary operator Distance
- Boolean Topological spatial operations - WHERE
clause - Touch
- Cross
- Using spatial analysis and topological operations
- Buffer, overlap
- Complex SQL examples
- Using spatial analysis and topological operations
- Aggreagate SQL queries
- Nested queries
12Spatial Query Examples (1)
- Using spatial operation in SELECT clause
- Query List the name, population, and area of
each country listed in the Country table. - SELECT C.Name,C.Pop, Area(C.Shape)AS "Area"
- FROM Country C
- Note This query uses spatial operation,
Area().Note the use of spatial - operation in place of a column in SELECT clause.
13Spatial Query Examples (2)
- Using Spatial Operation in WHERE clause
- Query Find the names of all countries which are
neighbors of the United States (USA) in the
Country table. - SELECT C1.Name AS "Neighbors of USA"
- FROM Country C1,Country C2
- WHERE Touch(C1.Shape,C2.Shape)1
- AND C2.Name USA
- Note Spatial operator Touch() is used in WHERE
clause to join Country table - with itself. This query is an
example of spatial self join operation
14Spatial Query Examples (3)
- Spatial Query with multiple tables
- Query For all the rivers listed in the River
table, find the countries through which they
pass. - SELECT R.Name, C.Name
- FROM River R, Country C
- WHERE Cross(R.Shape,C.Shape)1
- Note Spatial operation Cross is used to join
River and Country tables. This - query represents a spatial join operation
15Spatial Query Examples (4)
- Using spatial operation in an aggregate query
- Query List all countries, ordered by number of
neighboring countries. - SELECT Co.Name, Count(Co1.Name)
- FROM Country Co, Country Co1
- WHERE Touch(Co.Shape,Co1.Shape)
- GROUP BY Co.Name
- ORDER BY Count(Co1.Name)
16Outline
- Introduction to Spatial Databases
- Spatial Modeling
- Data Models
- Modeling of Spatial Data Types (SDTs)
- Modeling of Spatial Operations
- Database Design and Query Examples
- Design
- Formal Definition Methods
- Implementation
- Data Structures for SDTs
- Algorithms for atomic SDT Operations
17Design Criteria for Spatial Data Modeling
18Closure Properties
- Closure
- The domains of SDTs (Point, Line, Regions) should
be closed under Geometric Union, Intersection and
difference - Important The result of the geometric operation
must be a well-defined object AND correspond to
the definition of spatial data types
19Euclidean Geometry vs Discrete Geometric Bases
- Euclidean Space
- Number System is continuous and infinite
- Basis of Computational Geometry Algorithms
- Compute number systems are finite and discrete
- Leads to Numerical Robustness and Topological
Correctness problems - NEED Theory for modeling and design of spatial
data that is compatible with the finiteness of
computers - Left to implementer - gt leads to errors in Query
processing - D moved to D due to rounding errors
-
20Numerical Robustness approaches
- Proposed Solution
- avoid computation of any new intersection points
within geometric operations - The Geometric basis is updated before treatment
of numerical problems - Approaches
- Simplicial Complexes
- Frank Kuhn 1986
- Egenhofer, Frank Jackson 1989
- Realms
- Güting Schneider 1993
- Schneider 1997
-
21Simplicial Complexes
- Based on Combinatorial Topology
- Topological relations are separately recorded and
independent of metric positions - For each dimension d, a d-simplex is a minimal
object in that - dimension
- - Rule Any d-simplex is composed of (d1)
simplices of dimension d-1 - - Component of a simplex is called face (Edges
and Vertices) -
22Simplicial complex
- finite set of simplices such that the
intersection of any two simplices is empty or a
face
23Simplicial complex
- Two completeness principles
- - Completeness of Incidence the intersection of
two k-simplices is either empty or a face of both
simplices - no line intersection at points which are not
start or end points of the lines - no two geometric objects may exist at the same
location (geometry only recorded once) - - Completeness of Inclusion every k-simplex is
a face of a (k1)-simplex - all point are end points of lines, all lines are
boundaries of triangles, etc - no isolated points, no lines which are not part
of a boundary
24Simplicial complex
- Advantages
- maintenance of topological consistency
- approach fulfils closure properties
- Drawbacks
- - No spatial algebra has been defined on top of
this approach - - triangulation of space would lead to
space-consuming representations of spatial
objects - - no treatment of numerical problems additional
data structures needed to realize (at least
imprecise) metric operations
25Realms
- description of the complete underlying geometry
(all points and - lines) of an application or application
space - A finite set of points and non-intersecting line
segments defined over a grid such that - each point and each end point of a segment is a
grid point - each end point of a segment is also a point of
the realm - no realm point lies within a segment
- any two distinct segments do neither properly
intersect nor overlap
26Realms
- A realm is a spatially embedded planar graph
- All numerical problems are treated below the
realm layer - input application data that are sets of points
and intersecting line segments - output realmified data that have become
acquainted with each other - basic idea slightly distort/perturb both
segments
27Realms
- Advantages
- definition of distinct SDTs on a common domain,
guarantee of closure properties - protection of geometric computation in query
processing from problems of numerical - robustness and topological correctness
- enforcement of geometric consistency of related
spatial objects - Disadvantages
- no SDT operations possible that create new
geometries (leave the realm closure), e.g.,
convex_hull, voronoi - integration of realms into database systems
somewhat difficult, propagation of realm updates
to realm-based attribute values in database
objects
28Data Model Independence- Use of ADTs
- Modeling aspects
- Separation of DBMS data model and
application-specific data types/algebras - Modularity, conceptual clarity
- Reusability of ADTs for different DBMS data
models - Extensibility of DBMS data models
- Implementation aspects
- Modularity, information hiding, exchange of
implementations - Employment of specialized methods (e.g.
Computational Geometry for SDTs) - Efficiency of data structures for data types and
algorithms for operations
29Formal Definition Methods
- Need for Formal Definition Methods
- Users level
- Guaranteed clarity and consistency
- Designers level
- Better understanding of the complex semantics of
spatial objects and operations - Implementation Level
- formal specification of SDTs for a possible
realization - First step towards standardization of Spatial
Data Types (SDTs) - Formal definition of SDTs ? Formal definition of
corresponding - spatial operations
- consideration of the finiteness of computers and
the problems of numerical robustness and
topological correctness
30Formal Definition Methods
- Point Set Theory
- Point Set Topology
- Finite Set Theory
- Other Formal Approaches
31Point Set Theory
- Basic Assumption
- Space is composed of infinitely many points and
contains a set of spatial objects - Each spatial object can be regarded as the point
set occupied by that object - Point Set is a SET ? Set Operations can be
applied to Point Sets
32Point Set Topology
- Same basic assumptions as point set theory
- Investigates properties that are independent of
an underlying distance or coordinate measure
(metric) and that are preserved under continuous
topological transformations
33Outline
- Introduction to Spatial Databases
- Spatial Modeling
- Data Models
- Modeling of Spatial Data Types (SDTs)
- Modeling of Spatial Operations
- Database Design and Query Examples
- Design
- Formal Definition Methods
- Implementation
- Data Structures for SDTs
- Algorithms for atomic SDT Operations
34SDT Implementation
- Goal
- Implementation of a spatial type system (spatial
algebra) so that it can be integrated into a DBMS
(query processing, storage management, user
interface, etc.), fulfilling the design criteria - Tools
- Data Structures and Algorithms
- Data Structures Representation for the SDTs
- Algorithms Implementation of Atomic SDT
Operations
35Representing SDT Values
- The representation of a value of a SDT (e.g
Region) has to be simultaneously be compatible
with 2 views - Database System view
- Spatial Algebra view
36DBMS Perspective
- The SDT Representation
- Is the same as that of attribute values of other
types with respect to generic Operations - Can have varying and possibly very large size
- resides permanently on disk and is stored in one
page or a set of pages - can efficiently be loaded into main memory, where
it is given as a value of some variable
(typically, a pointer variable) to the procedures
implementing operations of the spatial algebra - offers a number of type-specific implementations
of generic operations needed by the DBMS
37DBMS Perspective
- To fulfill DBMS Requirements SDT Representation
must - Be a Paged Data Structure
- Consist of a single contiguous byte block fitting
into a page, or a large byte-block cut into
page-sized pieces - For efficient loading and
storing on disk - Large value Split into small
- info part summary info DBMS object
representation - Exact Geometry part Long sequence of vertices
logical pointer from info part to page sequence - Generic Approximations are needed
-
38Spatial Algebra implementation Perspective
- The SDT Representation
- is a value of some programming language data
type, e.g. region, is some arbitrary data
structure which is possibly quite complex, - supports efficient computational geometry
algorithms for spatial algebra operations, - is not geared only to one particular algorithm
but is balanced to support many operations well
enough.
39Spatial Algebra View
- representation contains approximations (e.g.,
bounding box) in the info part - representation contains stored values of unary
functions (e.g., area, perimeter, length, - number of components, etc.) in the info part
- representation contains plane sweep sequence in
the geometric part
40Implementation of SDT Operations
- Should use efficient algorithms from
Computational Geometry - Precheck on Approximations
- Stored function look up
- Plane Sweep
41Conclusion
- Conceptual and Detailed Overview of
- Spatial Modeling
- Design
- Implementation
- Basis for further discussions and development of
the concepts of Spatial Databases
42 43