Copyright, 1998-2014 © Qiming Zhou
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
TPU-based Population Density0 - 1200012000 - 3520035200 - 5920059200 - 102400102400 - 193700
Distance Zones to Hospital123
Population Density0 - 1270012700 - 3690036900 - 6870068700 - 110700110700 - 193700
# Surveyed Hospitals
6 0 6 12 18 24 Kilometers
#
###
#
#
#
#
#
#
#
##
# #
#
#
#
#
#
S
N
EW
Hong Kong Hospital Coverage
GEOG3600. Geographical Information Systems
GIS Data Modelling
GIS Data Modelling 2
GIS data modelling
What is a data model? GIS data models
CAD, graphical and image GIS data models
Raster data model Vector data model Object data model
GIS Data Modelling 3
What is a data model?
The heart of any GIS is the 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.
GIS Data Modelling 4
The role of a data model in GIS
PeopleInterpretation
and Explanation
Operational GIS
Analysis and Presentation
GIS Data Model
Description and Representation
Real World
GIS Data Modelling 5
Levels of data model abstraction Reality: real world phenomena Conceptual model: human-oriented model of
selected objects and processes in relevance, often partially structured
Logical model: implementation-oriented representation of reality, often expressed in the form of diagrams and lists
Physical model: portrays the actual application in a GIS, often comprises tables stored as files or databases.
GIS Data Modelling 6
Levels of abstraction
Reality
Conceptual model
Logical model
Physical model
Increasing abstraction
Human-oriented
Computer-oriented
GIS Data Modelling 7
Conceptual modelA road:• Centre line
(position)• Edge line (width)• Shoulder• Number of lanes• One way/two way• Speed limit• Traffic conditions
• Pavement• Underground
structure• Intersections• Date of completion• Maintenance date… …
Road
Line
Area
Attributes
Centre line
Network
Intersection
Main section
Shoulder
Speed limit
No. of Lines
GIS Data Modelling 8
Logical modelRoad Line-id Area-id Road No. Name … …
Line-id S-Node E-Node Vertices Length … …
Area-id Left edge Right edge Pavement Area … …
Vertices x,y, …, … …
Vertices x,y, …, … …
Vertices x,y, …, … …
GIS Data Modelling 9
Physical model
RoadR-line R-area R-…
… …
Record 1 Line-id Area-id Road No. Name … …
Record 2 Line-id Area-id Road No. Name … …
Record n Line-id Area-id Road No. Name … …
File: Road
Record 1 S-Node E-Node Vertices Length … …
Record 2 S-Node E-Node Vertices Length … …
Record n S-Node E-Node Vertices Length … …
… …
File: R-line
Road
GIS Data Modelling 10
GIS data models
CAD, graphical and image GIS data models
Raster data model Vector data model Object data model
GIS Data Modelling 11
Geographical data models used in GIS
Data model Application
Computer-aided design Simple mapping
Image Image processing and simple grid analysis
Raster/grid Spatial analysis and modelling
Vector/geo-relational topological
Operations on vector geometric features
Network Network analysis
Triangulated irregular network (TIN)
Terrain analysis
Object Operations on all types entities
GIS Data Modelling 12
CAD, graphical and image GIS data models The earliest GIS were based on very simple
models. CAD data model:
Local drawing coordinates Objects do not have unique identifiers. No relationship details between objects are
stored. Simple graphical data model: cartography Image model: field data rather than objects.
GIS Data Modelling 13
The CAD data model
A CAD model focuses on feature drawing only so that it does not represent any kind of relationships between objects.
GIS Data Modelling 14
Simple graphical data model
A simple graphical data model is adequate to make a cartographic representation of Hong Kong SAR.
GIS Data Modelling 15
Image data model
Image data: On the left is the false colour composite of Landsat ETM image using Band 4, 3 and 2. On the right is the classification of the image using 6 bands of the Landsat ETM images (excluding Band 6).
GIS Data Modelling 16
Raster data model
Raster data model uses an array of cells, or pixels, to represent real-world objects.
Difference between raster and image data models: 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 fields.
Applications: image data: image processing; raster data: spatial analysis and modelling
GIS Data Modelling 17
Grid with attributes
GIS Data Modelling 18
Data structure of raster data model Cartographic model (database) Map layer (overlay, coverage, grid) Zone (region) Location
GIS Data Modelling 19
Hierarchy of the raster data structure
CartographicModel
CartographicModel Map layerMap layer
ZoneZone
OrientationOrientation
ResolutionResolution
TitleTitle
Map layerMap layer
Map layerMap layerValueValue
LabelLabel
ZoneZone
ZoneZone LocationLocation
LocationLocation
LocationLocation Rowcoordinate
Rowcoordinate
Columncoordinate
Columncoordinate
GIS Data Modelling 20
Cartographic model
The data for an area can be visualised as maps or layers.
A cartographic model is a set of data describing selected characteristics of each location within a bounded geographic area in the form of map-like layers.
GIS Data Modelling 21
Cartographic model (cont.)
1
23
1
2
3
Topography
Soil types
Forest types
Buildings
Real world
3
3
3
3
3
3
3
3
3
3
3
1
1
3
3
3
3
1
1
1
1
3
1
1
1
1
1
1
1
1
1
2
2
1
1
2
2
2
2
2
2
1
2
2
2
2
2
1
1
Soils
GIS Data Modelling 22
Map layer
A map layer is a set of data describing a single characteristic of each location within a bounded geographical area.
Only one item of information is available for each location within a single layer.
Major components of a layer are its resolution, orientation and zones.
GIS Data Modelling 23
Map layer (cont.)
AustraliaNew South Wales
Victoria
Queensland
South Australia
West Australia
Tasmania
Y
X
Northern Territory
N
GIS Data Modelling 24
Zone
A zone is a set of contiguous location that exhibit the same characteristic.
Term class is often used to refer to all individual zones that have the same characteristics.
Major components of a zone are its value, label and locations.
GIS Data Modelling 25
Zone and class
Class A
Class B
Class C
Class D
Class E
1 2
34 5
67
89
10 1112
1 Zone number
GIS Data Modelling 26
Value and label of a zone
Value The item of information stored in a layer for
each cell or pixel Cells in the same zone have the same value
Label “Additional” information associated with each
zone Can be numeric or alphabetic (i.e. numbers or
text)
GIS Data Modelling 27
Zone (cont.)
AustraliaNew South Wales
Victoria
Queensland
South Australia
West Australia
Tasmania
Y
X
Northern Territory
N
State ID State Name Capital Population
02 New South Wales Sydney 7200000
07 Queensland Brisbane 1800000
GIS Data Modelling 28
Location
A location is the smallest unit of geographical space for which data a recorded (also called cell or pixel).
A location is defined as that a portion of the cartographic plane is uniquely identified by an ordered pair of coordinates (row and column numbers).
GIS Data Modelling 29
Vector data model
Simple features Topological features Network data model TIN data model
GIS Data Modelling 30
Vector representations
point line area
Scale city
wells
highway
political boundary
streams
agriculture land
urban land
city
highway
airport
GIS Data Modelling 31
Multiple representation
Small-scale representation of cities as points Large-scale representation of cities as areas
GIS Data Modelling 32
Simple features1
24
3
2
1
2
1
Point number x, y coordinates1 (2, 8)2 (3, 3)3 (12, 7)4 (9, 4)
Line number x, y coordinates1 (1, 6), (4, 8), (8, 6), (13,
8)2 (1, 3), (4, 4), (9, 2), (13,
5)
Polygon number x, y coordinates1 (2, 5), (3, 8), … (2, 5)2 (6, 4), (8, 4), … (6, 4)
GIS Data Modelling 33
The “spaghetti” structure
10
63 64 23
63 64 23
10
Original map
Map expressed inCartesian coordinates
Feature Number Location
Point
Line
Polygon
X Y (single point)
X1 Y1, X2 Y2, …, Xn Yn (string)
X1 Y1, X2 Y2, …, X1 Y1 (closed loop)
X1 Y1, X2 Y2, …, X1 Y1 (closed loop)
10
23
63
64
GIS Data Modelling 34
Topological features
Topological features are simple features structured using topological rules.
Topology is the science and mathematics of relationships.
In GIS, topology is used to validate the geometry of vector datasets.
GIS Data Modelling 35
Arcs
When planar enforcement is used, area objects in one layer cannot overlap and must exhaust the space of a layer.
Every piece of boundary line is a common boundary between two areas.
The stretch of common boundary between two junctions (nodes) may be called edge, chain, or arc.
Arcs have attributes which identify the polygons on either side (“left” or “right”). In what direction by which we can define “left” or
“right”? Arcs are fundamental for topological features.
GIS Data Modelling 36
Arcs (cont.)
Start node
End notevertex
An Arc
GIS Data Modelling 37
Arc-node structure
N3
N1
N2
N6
N5
N4
a1
a2
a3
a4
a5
a6
A
B
C
Polygon topology
Polygon Arcs
A
B
C
a1, a5, a3
a2, a5, 0, a6
a6
0 Outside map
Node topology
Node Arcs
N1
N2
N3
a1, a3, a4
a1, a2, a5
a2, a3, a5
N4 a4
N5
N6
0
a6
Arc coordinates
ArcStartX, Y
a1
a2
a3
40,60
70,50
10,25
a4 40,60
a5
a6
10,25
55,27
IntermediateX, Y
EndX, Y
70,60
70,10; 10,10
10,60
30,50
20,27; 30,30; 50,32
55,15; 40,15; 45,27
70,50
10,25
40,60
30,40
70,50
55,27
Arc topology
ArcStartNode
a1
a2
a3
N1
N2
N3
a4 N4
a5
a6
N3
N6
EndNode
LeftPolygon
RightPolygon
N2
N3
N1
N1
N2
N6
0
0
0
A
A
B
A
B
A
A
B
C
GIS Data Modelling 38
Topological features
GIS Data Modelling 39
Network data model
GIS Data Modelling 40
TIN data model
X-Y Coordinates
node# coordinates
1
2
3
11
. . .
x1, y1
x2, y2
x3, y3
. . .
x11, y11
Z Coordinates
node# z_value
1
2
3
11
. . .
z1
. . .
z2
z3
z11
1
2
3
6
5
87
9
11
10
4
A
B
C
D
E
F
G
H
I
JK
LM
NTriangle Table
node#
A
B
C
D
E
F
G
H
I
J
K
L
M
N
1, 6, 7
1, 7, 8
1, 2, 8
2, 8, 9
2, 3, 9
3, 4, 9
4, 9, 10
4, 5, 10
5, 10, 11
5, 6, 11
6, 7, 11
7, 8, 9
7, 9, 10
7, 10, 11
Id# area slope … …
… … … … … …
GIS Data Modelling 41
Creating TIN from contours
GIS Data Modelling 42
TIN surface
GIS Data Modelling 43
Object-oriented concepts
An object is a self-contained package of information describing the characteristics and capabilities of an entity under study.
In a geographical object data model, the real world is modelled as a collection of objects and relationships between them.
Each entity in the GIS is an object. A collection of objects of the same type is
called a class.
GIS Data Modelling 44
Object data model
For GIS purposes it is not sufficient merely to hold data on map elements in the data base. It must also be possible to access the operations to be performed on these elements.
An object is an entity that has a state represented by the values of local variables (instance variables) and a set of operations or methods (instance methods).
Individual objects belong to a class that defines the type of object.
Each class has a superclass from which it can inherit both instance variables and methods.
GIS Data Modelling 45
Example: LanduseLanduse object definition Polygon object definition
Superclass (object) Superclass (Landuse)
Class variablesClass-idClass name
Class variablesPolygon-idBorderline-id
Instance variablesList of polygonsClass descriptions
Instance variablesList of borderlinesArea
Instance methodsRe-classCalculate class statistics
Instance methodsDrawCalculate centroid
Boderline object definition
Superclass (polygon)
Class variables (node-id, …)
Instance variables (start-node, end-node, …)
Instance methods (edit vertices, …)
GIS Data Modelling 46
Landuse object structureObject
Landuse
Class 1
Class 2
Class 3
Polygon Borderline
Polygon 1
Polygon 3
Polygon 2
Borderline 1
Borderline 2
Borderline 3
Borderline 4
GIS Data Modelling 47
Implementation of O-O model
GIS Data Modelling 48
Three key hallmarks of object orientation Polymorphism Encapsulation Inheritance
GIS Data Modelling 49
Polymorphism
Application Application
Geospatial database access objects
Geospatialdatabase Coverage CAD data
Polymorphism
Applications
Data components
Data sources
GIS Data Modelling 50
Encapsulation
FeatureData set
Encapsulation
Table
Data set
Object ClassRelationship
Class
FeatureClass
GIS Data Modelling 51
Inheritance
SimpleRoad
Feature
Inheritance
Standardfeature types
Customfeature types
ComplexRoad
Feature
RoadFeature
Roadcentral line
Roadedge
Overpass
GIS Data Modelling 52
Advantages
The ‘natural’ model: directly corresponds to the object found in reality.
Completeness: every object is completely bounded with a defined ‘shell’.
Inheritance: a class can include subclasses that can inherit both its data and methods.
Openness: allows to modify and expand instance variables and methods.
GIS Data Modelling 53
Summary The heart of a GIS is the data model it
employs. With increasing level of abstraction, models are
created from human-oriented conceptual, logical to computer-oriented physical models
There is no single type of GIS data model that is best for everything.
Commonly used data models include: CAD, graphical and image data models Raster data model Vector data model Object-oriented data model