What is a data model
Download
Report
Transcript What is a data model
Lecture 3 spatial data
modeling and management
spatial data modeling and management
2016年4月7日
Spatial data structure
Comparison of vector and raster
Introduction to spatial database
Data models in traditional database
Data base for GIS
2
What is a data model ?
The heart of any GIS is data model
A data model is a set of constructions for
describing and representing selected aspects of
the real world in a computer
There is no single type of GIS data model that is
best for all circumstances
2016年4月7日
3
The role of a data model in GIS
2016年4月7日
4
GIS data models
CAD 、geographical and image GIS data model
Raster Data Model
Vector Data Model
Object Data Model
2016年4月7日
5
2016年4月7日
6
The CAD data model
A CAD model focuses on feature
drawing only ,so that it does not represent
any kind of relationships between objects
2016年4月7日
7
Image data model
2016年4月7日
8
Difference between image data model and raster data model
Image data do not have attribute table attached,so
that they have only one attribute field.
Raster data have attribute table that can be joint to
other tables ,so that they can have multiple attribute
field.
application:
image data---image processing
raster data---spatial analysis and modeling
2016年4月7日
9
Vector data model
Vector data model uses a set of coordinate
and relationship to represent real world
objects。
Geometry objects:
Point:single point
Line:string
Area:closed loop
other vector model:
Triangulated Irregular Network:surface
Region
Dynamic segmentation:network
2016年4月7日
10
Vector data model:acquisition
Surveying instruments(total station、GPS、
level,etc.)
Digitize map
Indirect methods:
Rater to vector
Data from spatial analysis
2016年4月7日
11
Vector data model:how to describe
Storage and management of vector data
Associate geometry data and attribute data
Relationship of spatial objects
2016年4月7日
12
Vector data model cont.
(
)
2016年4月7日
Vector data model—the spaghetti structure
Only to record position and attribute information
of the spatial object,but not topological
relationship
Storage:
Independence :spatial objects with its geometry
information
Point dictionary:coordinate storage is separated from
its spatial objects
Characters:
no topological relationship ,so that only can be used to
presentation and simple query of spatial object
Exists data redundancy
Can not keep consistency of the data,for the common part
repeats storage
Spatial analysis is more complicated
Can not deal with the operation of polygon
Appropriate applications:
For the disadvantages that stated above,this data structure can
be used to map and general query,but not for spatial analysis
13
Vector data model cont.
(
)
2016年4月7日
database
ID
Attribute
Encoding
point: ( x ,y )
line: ( x1 , y1 ) , (x2 , y2 ) , … , ( xn , yn )
area: ( x1 , y1 ) , (x2 , y2 ) , … , ( x1 , y1 )
Geometry
point
Point
dictionary
Encoding of spatial objects
Sole
Associate the attribute and position
line
area
No
X
Y
1
11
22
2
33
44
…
…
…
n
55
66
14
Vector data model:example of spaghetti structure
polygon
code
coordinate
A
t123
1,2
3,4
…
B
2
t124
No. of
point
coordinate
1
2
3
4
5
1,2
3,4
5,6
7,8
…
5,6
3
A
7
1
6
polygon
code
No. of point
A
B
T123
t124
1,2,3,4,7,6,1
1,6,7,4,5,1
B
4
5
2016年4月7日
15
Vector data model cont.
(
)
2016年4月7日
Vector data model:the topological structure
Not only expressed the position and attribute of
objects,but also relationship between objects
Generally the topological relationship is conjunction
The conjunction can be expressed in full expression
and part expression
Storage
Directly storage
Serial pointer
Topological relationship and data share
Conditions of using topological relationship
16
Vector data model cont.
Vector data model : full expression
M
A1
A2
B1
N1
(
)
2016年4月7日
A3
A6
N5
A4
Arc
A5
B2
B3
B1
Area
N2
N3
B2
B3 B4
A1 A2 A3 A4 A5 A6 A7 A8
Node
N1
N2
N3
N4 N5
B4
A7
N4
A8
Polygon
Arc
Arc-node
Arc
from
Node-arc
Nod e
Arc
Arc
Left
Polygon-arc
Arc-polygon
to
Right
17
Vector data model cont.
(
Vector data model:part expression
Using part table to describe topological relation
System9:polygon-arc 、arc-node
DIME:arc-node、arc-polygon
The topological relationship is all in the above
states in current GIS
)
2016年4月7日
18
Vector data model cont.
Topological structure:how to describe in computer
(
pointer
polygon-arc、node-arc:it is not convenient
directly storage for unequal length of record
Example:POLYVRT
TIGER
Directly storage
Arc/Info、GeoStar
)
2016年4月7日
19
Vector data
model£¨cont.£©
Topological structure:topological relationship and data share
To keep data consistent
2016年4月7日
20
Vector data model cont.
Topological relations:when to use topological structure
(
Application
Map and general query can not use topological structure
Topological relation can be used to spatial analysis
Objects can be described with topological relation
Polygon object:polygon-arc、arc-polygon
Network object:node-arc、arc-node
)
2016年4月7日
21
Vector data model:attribute
Type
type :what is the object?
explanation information:different attribute with the
same object
description
Encode
Attribute table
The item of attribute table depends on users
2016年4月7日
22
Map graphic data to attribute data linkage
ID
Encoding Coordinate
ID
Geodesic Geodesic
Control-point
Precision
……
years organization
grade
ID
Encoding Coordinate
ID
Grade
ID
Encoding
ID
owner
point
Spatial objects
line
area
Material Breadth
related line
from、to、left、right
Build
time
Management
……
organization
No. of
boundary
Build
Build
Building
structure ……
time organization area
Type of object and attribute
Encoding
2016年4月7日
Name of
object
Type of
geometry
Map color
Map sign
encoding
Attribute
23
Triangulated irregular network
6
1
A
11 J
K
EDGES
5
B
NODES
7
C
adjacent
8
node#
A
B, K
A
1, 6, 7
B
A, C, L
B
1, 7, 8
C
B, D
C
1, 2, 8
2
N
I
L
M
D
10
9
H
G
E
D
C, E, L
D
2, 8, 9
E
D, F
E, G
E
F
F
2, 3, 9
3, 4, 9
G
F, H, M
G
4, 9, 10
H
G, I
H
4, 5, 10
I
H, J, N
I
5, 10, 11
J
I, K
J
5, 6, 11
K
A, J, N
K
6, 7, 11
X-Y Coordinates
Z Coordinates
L
L
7, 8, 9
node#
node#
M
B, D, M
G, L, N
M
7, 9, 10
1
x1, y1
1
z1
N
I, K, M
N
7, 10, 11
2
x2, y2
2
z2
3
x3, y3
3
z3
...
...
...
...
3
11
2016年4月7日
4
F
coordinates
x11, y11
11
z_value
z11
24
Triangulated irregular network (cont.)
2016年4月7日
25
Dynamic segmentation
Dynamic segmentation associates multiple sets of attributes to
any portion of a linear feature
Elements of dynamic segmentation :
Route--- A route is a linear feature on which attributes are defined
Measure---Each route is associated with a measurement system
Events---Attributes associated with a route
Advantage of dynamic segmentation
• Define linear feature within a line coverage
• Work with data in route-measure format
• Apply attributes in route-measure to any part of a route without
modifying underlying coordinate data
Used to network analysis
2016年4月7日
26
Vector data structure:advantages and disadvantages
Distinct location and implicit attribute
Represent spatial relation with topological
relationships
Object-based operation with high accuracy and less
data redundancy
Difficult to combine with RS data
High quality graphics
2016年4月7日
27
Raster data structure:contents
Definition
Divides the entire study area into a regular grid of cells,each cell
contains a single value
In rater data structure
Point:pixel or cell
Line:represented in cluster of adjacent pixel。
Area:pixel with same attribute that are congregated
Data sources:
Remote sense image
Scanner
Vector to raster
Manual
Raster coordinates
Compress raster data
Raster layers
Rater data file structures
Advantage and disadvantage of raster data structure
2016年4月7日
28
Area
Line
Point
2016年4月7日
29
Raster data structure:coordinate system and parameters
Grid direction
Resolution
North-west
coordinate
(XWS,YWS)
2016年4月7日
X:Row
Y:Col
30
Raster data structure:assign value to cell
C
A
B
2016年4月7日
C
Area
importance
A
A
AB
31
Raster data structure:compression
1
2
3
4
5
6
7
8
1
A
A
A
A
A
A
A
R
2
A
A
A
A
A
R
R
A
3
A
A
A
A
R
A
A
A
4
A
R
R
R
A
A
A
A
5
R
A
A
A
G
G
G
A
6
A
A
G
G
G
G
G
A
7
A
A
G
G
G
G
G
A
8
A
A
A
A
G
A
A
A
Chain codes
Number of start row and
column,unit vector
R: (1,5),3,2,2,3,3,2,3
7
4
0
3
1
Run-length codes Recording on row or column
No. of row ,attribute, number of repeats
1, A, 4, R, 1, A, 4
SE
NE
5
2
Block codes
Quarter-tree
codes
NW
6
Rectangle
Initial position, radius, value
(1,1,3,A),(1,5,1,R),(1,6,2,A),¡
SW
G
GGGAGGAAGAAA
2016年4月7日
32
Hierarchy of the raster data structure
Building
Z
Forest
Soil
relief
Y
X
2016年4月7日
33
File structure of the raster data structure
Each cell is referenced
directly , Map file
Point
X coordinate
Each overlay is referenced
directly, Map file
Overly
Point
Y coordinate
tile
Overlay
Z value
Overlay values
Next overlay
values
…
Next point
(X,Y) coordinate
Each mapping unit is referenced
directly
Next
point
…
…
…
Scale
Mapping
unit 1
Display
symbol
Attribute
Next
overlay
X,Y
Coordinates
pairs
…
…
Next mapping
unit
…
2016年4月7日
Lable
Next
overlay
34
Raster data structure:advantages and disadvantages
Spatial object represented in discrete cell value
Location is implicit and attribute is distinct
Simple data structure and easy to combine
with RS data
Existing errors in geometry and attribute
Difficult to build the relationship between
spatial objects
2016年4月7日
35
c
Geometry bias
Ac distance: 7/4 (5)
area: 7
(6)
5
a
c
3
4
b
a
b
Attribute bias
2016年4月7日
36
Comparison of vector and raster data model
Vector model
advantages:
advantages:
•It provides a more compact data
structure than the raster model
• It is a simple data structure
•It provides efficient encoding of
topology ,and as a result ,more
efficient;implementation of
operations that require topological
information ,such as network
analysis
• High spatial variability is efficiently
represented in a rater format
•The vector model is better studies to
supporting graphics that closely
approximate hand-drawn maps
disadvantages:
2016年4月7日
Raster model
•It is a more complex data structure
than a simple raster
•Overlay operations are more difficult
to implement
•The representation of high spatial
variability is inefficient
•Manipulation and enhancement of
digital images can not be efficiently
done in the vector domain
• Overlay operation are easily and
efficiently implemented
• The raster format is more or less
required for efficient manipulation and
enhancement of digital images
disadvantages:
• The raster data structure is less compact
• Topological relationships are more
difficult to represent
• The output of graphic is less aesthetically
pleasing because boundaries tend to have
a blocky appearance rather than the
smooth lines of hard-drawn maps.this can
be overcome by using a very large
numbers of cells ,but may result in
unacceptable large files
37
Principles of selecting data models
Object or fields
Acceptable data
Necessary accuracy of spatial objects location
Topological relationships
Type of spatial analysis
Type of map
2016年4月7日
38
Spatial data management:spatial database
data base
A data base is defined as structured collection of
information on a defined subject
characters:
Data is independent on application programs
Relationship of data represent the connection of
information in the real world
Conventional data base management structures
Hierarchy database structure
Network database structure
Relational database structure
2016年4月7日
39
Spatial data management:spatial database(cont.)
Spatial database
A spatial data base is a collection of geographical
data and information on a defined area
characters:
Huge data quantity
Location and attribute data combined
Broad application areas
Features of spatial data base
spatiality
Non-structured
Spatial relationships
Classification encoding
Huge data quantity
2016年4月7日
40
Comparison of conventional database and spatial database
Conventional
database
Spatial database
continuous/correlation
Discontinuous
Non-correlation
Continuous
Spatial correlation
Type of entity/spatial
relationship
Few
Steady
Many
Unsteady
Structured
Equal
Non-structured
Unequal
Record length
Query and
manipulation
2016年4月7日
Spatial operations
words、numbers besides words and
numbers
41
Spatial database management
Hybrid model based on data file and
relational database
Extended model based on relational
database
Integrated model based on objectrelation database
2016年4月7日
42
Spatial data management based on file-relational database
GIS interface
ID
Development
language
DBMS
Graphic process
attribute
location
Graphic interface
early
Graphic process
database
data file
Graphic file
database
Attribute interface
DBMS
Attribute
database
Graphic file
database
Attribute
database
GIS interface
Development
language
Graphic process
Graphic file
database
2016年4月7日
Database development
language
ODBC agreement
DBMS
Attribute
database
43
Spatial data management based on relational database
Attribute data
(equal records)
GIS interface
Spatial data
(unequal records)
Relational
tables
Binary
blocks
DBMS
Spatial
database
2016年4月7日
44
Spatial data management based on object-relation database
GIS
interface
Spatial data process
DBMS
Extend entities type
Spatial
database
2016年4月7日
45
GIS spatial data organization
Arc/Info
Concomitant
control
Work layer
Study domain
GIS project
Spatial
index
Workspace 1
MGE
GeoStar
objects
Logic layer
Workspace2
MGE
GeoStar
Workspace n
Attribute
2016年4月7日
Arc/Info
46
Spatial data index
What is spatial data index
Why is spatial data index needed in
GIS
How to build spatial data index
2016年4月7日
47
Spatial data index:object range index
Collection of spatial objects
Xmax
1
4
5
Ymin
6
3
4
Ymax
Ymin
1
…
…
…
…
2
…
…
…
…
3
…
…
…
…
…
…
…
…
…
Xmax>=XN OR Xmin<=XS OR
XN
Ymax>=YE OR Ymin<=YW
No
2016年4月7日
Xmin
Xmin
XN
XS
Xmax
Ymax
2
YW Retrieved windows
ID
YE
XE<=Xmax,Xmin<=XN AND
YW<=Ymax,Ymin<=YE
YES
YW
6
YE
3
2
XS
48
Spatial data index :index based on grid
1
2
3
1
2
3
4
1
2
3
1
3
7
5
2
4
9
10
4
1
2
8
6
3
P(2,1)=7 P(2,2)=8 P(2,3)=1
4
ID
P
1
0
2
0
3
0
4
0
5
2
6
0
7
3
8
5
9
0
10
9
P(3,1)=4 P(3,2)=10 P(3,3)=6
4
Header
pointer
Link pointer
2016年4月7日
49
作业:
简述常用空间数据结构的特点;
简述空间数据库的特征,目前空间数据是如
何进行管理组织的?
简述栅格数据的压缩编码方案
试给出格网索引实现的原理(建立和检索)
2016年4月7日
50