Ch2 Spatial Concepts Data Models
Ch2 Spatial Concepts Data Models
Introduction
Spatial Concepts & Models of Spatial Information
Data Models
Three-Step Database Design
Extending the ER Model with Spatial Concepts
Object-Oriented Data Modeling with UML
Prof. Chuan-Ming Liu Summary
CSIE
National Taipei University of Technology
1 2
Mobile Computing & Software Engineering Lab Mobile Computing & Software Engineering Lab
7 8
Mobile Computing & Software Engineering Lab Mobile Computing & Software Engineering Lab
11 12
Mobile Computing & Software Engineering Lab Mobile Computing & Software Engineering Lab
Field Model v.s. Object Model Field-Based Model
The decision to use either model depends on Three main components:
the requirement of the applications. Spatial Framework is a partitioning of space
e.g., Grid imposed by Latitude and Longitude
Field models are often used to model
continuous spatial trends, including Field Functions
temperature, elevation, etc. f: Spatial Framework Attribute Domain
Field Operations
Object models are more common in modeling
Examples, addition(+) and composition(o).
transportation network, land parcels, etc f + g : x f ( x) + g ( x)
f g : x f ( g ( x))
13 14
Mobile Computing & Software Engineering Lab Mobile Computing & Software Engineering Lab
17 18
Mobile Computing & Software Engineering Lab Mobile Computing & Software Engineering Lab
Example Object Models Spatial Data Types
Example from a roadmap In object-based models, a key issue is the
Objects: roads, landmarks, ... choice of a basic set of spatial data types used
Attributes of road objects: to present data.
spatial: location, e.g. polygon boundary of land-parcel The geometry described via a spatial
non-spatial: name (e.g. Route 66), type (e.g. interstate, representation system is commonly used to
residential street), number of lanes, speed limit,
represent the spatial shapes.
Operations on road objects:
determine center line
determine length
determine intersection with other roads
... Mobile Computing & Software Engineering Lab 19
Mobile Computing & Software Engineering Lab
20
Line String Polygon Multisurface Multicurve Multipoint Set-Oriented Union, Intersection, Containment,
1..*
2..*
Toplogical Touches, Disjoint, Overlap, etc.
Line LinearRing 1..* Multipolygon Multilinestring
Directional East,North-West, etc.
23
Metric Distance 24
Mobile Computing & Software Engineering Lab Mobile Computing & Software Engineering Lab
Topological Relationships Example Topological Operations
Topological Relationships Example queries with topological operations
invariant under elastic deformation (without tear, What is the topological relationship between two
merge). objects A and B ?
Two countries which touch each other in a planar Find all objects which have a given topological
paper map will continue to do so in spherical globe relationship to object A ?
maps.
Topology is the study of topological
relationships
25 26
Mobile Computing & Software Engineering Lab Mobile Computing & Software Engineering Lab
35 36
Mobile Computing & Software Engineering Lab Mobile Computing & Software Engineering Lab
Conceptual DM: The ER Model (1) Conceptual DM: The ER Model (2)
Three basic concepts Comparison with Object model of spatial
Entities have an independent conceptual or physical information
existence. Entities, like objects, are collections of attributes
Examples: Forest, Road, Manager, ... ER model does not permit general user defined
Entities are characterized by Attributes operations
Example: Forest has attributes of name, elevation, etc. Relationships are not directly supported in Object
An entity interacts with another entity through model
relationships. but may be simulated via operations
Road allow access to Forest interiors.
This relationship may be name Accesses
37 38
Mobile Computing & Software Engineering Lab Mobile Computing & Software Engineering Lab
39 40
Mobile Computing & Software Engineering Lab Mobile Computing & Software Engineering Lab
models
M M N
supplies_water_to River Crosses Road
Several different graphic notations are used M
N
Name Accesses
We use a simple notation summarized below Within
Elevation N Polygonid
Polygonid
M 1
1 1 1 M
Concept Symbol Facility belongs_to Forest part_of Forest-Stand
Entities 1
1
Lineid Species
Attributes Name M monitors manages
1
Stand-id
Multi-valued Attributes
Name Fire-Station Manager
Relationships
Cardinality of Relationship 1:1, M:1, M:N Gender
Age
Pointid Name
41 42
Mobile Computing & Software Engineering Lab Mobile Computing & Software Engineering Lab
Exercise The Relational Model
According to the ER diagram Relational model is based on set theory
List the entities, attributes, relationships in this ER Main concepts
diagram Domain: a set of values for a simple attribute
Identify cardinality constraint for each relationship. Relation: cross-product of a set of domains
Represents a table, i.e. homogeneous collection of rows (tuples)
How many roads Accesses a Forest_stand? The set of columns (i.e. attributes) are same for each row
(one or many) Comparison to concepts in conceptual data model
Relations are similar to but not identical to entities
Domains are similar to attributes
Translation rules establishing exact correspondence are discussed in
2.2.3
43 44
Mobile Computing & Software Engineering Lab Mobile Computing & Software Engineering Lab
45 46
Mobile Computing & Software Engineering Lab Mobile Computing & Software Engineering Lab
Stand-id
(Integer)
Species
(varchar)
Forest-name
(varchar)
Stand-id
(Integer)
Polygonid
(Integer)
Relational model restricts attribute domains
Exercise: River River-Geom
simple atomic values, e.g. a number
Name Length Name Lineid
Forest Forest-Geom
Polygon Line
Figure 2.4, pp. 37 Name Name Polygonid
(varchar) (varchar) (Integer) Polygonid Seq-no Pointid Lineid Seq-no Pointid
Fire-Station Fstation-Geom
(Integer) (Integer) (Integer) (Integer) (Integer) (Integer)
Name ForName Name Pointid
(varchar) (varchar) (varchar) (Integer)
Point Elevation
Supplies_Water_To Road-Access-Forest
FacName RivName Volume RoadName ForName Pointid Latitude Longitude Forest-name Pointid (F.K.) Elevation
(varchar) (varchar) (Real) (varchar) (varchar)
(Integer) (Real) (Real) (varchar) (Integer) (Real)
Manager
49 50
Mobile Computing & Software Engineering Lab Mobile Computing & Software Engineering Lab
53 54
Mobile Computing & Software Engineering Lab Mobile Computing & Software Engineering Lab
Specifying Pictograms Basic Shapes and Collections
Grammar based approach Basic Shape
Rewrite rule Pictogram Shape
like English syntax diagrams
Classes of pictograms !
Point Line Polygon
Entity pictograms
basic: point, line, polygon Grammar (for Pictogram) Grammar (for Basic Shape) Pictograms for Basic Shapes
collection of basic Cardinality 0, 1
...
Relationship pictograms 1
Shape Basic Shape
partition, network
Multi-Shape 1, n
n 0, n
Derived Shape 0, n
Alternate Shape n
Part_of(Network) Part_of(Partition)
Grammar (for Shape) Pictograms Multishapes
Pictograms for Relationships 55 Grammar (for Cardinality) (using cardinality) 56
Mobile Computing & Software Engineering Lab Mobile Computing & Software Engineering Lab
Strong
UML does not have key attributes and integrity constraints
Facility * Forest Aggregation
Name Name
Elevation Weak
ERD does not have methods
GetName() 1 .. * belongs_to 1 *
accesses Aggregation
GetName()
1 GetElevation():
Point
1 * .. * Cardinality Relationships properties are richer in ERDs
1..*
manages
Entities in ER diagram relate to datasets, but UML class
monitor
Fire-Station
1..*
Forest-Stand Manager
1
diagram
Name SpecieName Name
GetName()
1 .. *
Age
Gender
can contain classes which have little to do with data
GetSpecieName()
GetName()
GetAge()
GetGender()
59 60
Mobile Computing & Software Engineering Lab Mobile Computing & Software Engineering Lab
Summary Summary
Spatial Information modeling can be classed A data model is a high level description of the
into Field based and Object based data
it can help in early analysis of storage cost, data
Field based for modeling smoothly varying
quality
entities, like rainfall
There are two popular models of spatial
Object based for modeling discrete entities, information
like country Field based and Object based
Database are designed in 3-steps
Conceptual, Logical and Physical
61
Pictograms can simplify Conceptual data 62
Mobile Computing & Software Engineering Lab models Mobile Computing & Software Engineering Lab