53

Click here to load reader

Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

Embed Size (px)

Citation preview

Page 1: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

Copyright, 1998-2012 © 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

Page 2: Copyright, 1998-2012 © Qiming Zhou 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

Page 3: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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.

Page 4: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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

Page 5: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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.

Page 6: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 6

Levels of abstraction

Reality

Conceptual model

Logical model

Physical model

Increasing abstraction

Human-oriented

Computer-oriented

Page 7: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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

Page 8: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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, …, … …

Page 9: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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

Page 10: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 10

GIS data models

CAD, graphical and image GIS data models

Raster data model Vector data model Object data model

Page 11: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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

Page 12: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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.

Page 13: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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.

Page 14: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 14

Simple graphical data model

A simple graphical data model is adequate to make a cartographic representation of Hong Kong SAR.

Page 15: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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).

Page 16: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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

Page 17: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 17

Grid with attributes

Page 18: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 18

Data structure of raster data model Cartographic model (database) Map layer (overlay, coverage, grid) Zone (region) Location

Page 19: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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

Page 20: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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.

Page 21: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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

Page 22: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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.

Page 23: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 23

Map layer (cont.)

AustraliaNew South Wales

Victoria

Queensland

South Australia

West Australia

Tasmania

Y

X

Northern Territory

N

Page 24: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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.

Page 25: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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

Page 26: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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)

Page 27: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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

Page 28: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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).

Page 29: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 29

Vector data model

Simple features Topological features Network data model TIN data model

Page 30: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 30

Vector representations

point line area

Scale city

wells

highway

political boundary

streams

agriculture land

urban land

city

highway

airport

Page 31: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 31

Multiple representation

Small-scale representation of cities as points Large-scale representation of cities as areas

Page 32: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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)

Page 33: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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

Page 34: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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.

Page 35: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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.

Page 36: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 36

Arcs (cont.)

Start node

End notevertex

An Arc

Page 37: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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

Page 38: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 38

Topological features

Page 39: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 39

Network data model

Page 40: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 40

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

N

EDGES

adjacent

A

B

C

D

E

F

G

H

I

J

K

L

M

N

B, K

A, C, L

B, D

C, E, L

D, F

E, G

F, H, M

G, I

H, J, N

I, K

A, J, N

B, D, M

G, L, N

I, K, M

NODES

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

TIN data model

Page 41: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 41

Creating TIN from contours

Page 42: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 42

TIN surface

Page 43: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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.

Page 44: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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.

Page 45: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 45

Polygon object definition Land parcel object definition

Superclasses (object) Superclasses (polygon)

Class variables

Number_of_polygons

Class variables

Instance variables

List_of_nodes

List_of_arcs

Area

Instance variables

Value

Owner

Instance methods

Calculate_centroid

Draw

Overlay

Instance methods

Transfer_ownership

Re_zone

Object data model (cont.)

Page 46: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 46

Object

Land ParcelPolygon

Polygon-1

Polygon-2

Land parcel-1

Object data model (cont.)

Land parcel-2 Land parcel-3

Page 47: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 47

Implementation of O-O model

Page 48: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 48

Three key hallmarks of object orientation Polymorphism Encapsulation Inheritance

Page 49: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 49

Polymorphism

Application Application

Geospatial database access objects

Geospatialdatabase Coverage CAD data

Polymorphism

Applications

Data components

Data sources

Page 50: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 50

Encapsulation

FeatureData set

Encapsulation

Table

Data set

Object ClassRelationship

Class

FeatureClass

Page 51: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

GIS Data Modelling 51

Inheritance

SimpleRoad

Feature

Inheritance

Standardfeature types

Customfeature types

ComplexRoad

Feature

RoadFeature

Roadcentral line

Roadedge

Overpass

Page 52: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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.

Page 53: Copyright, 1998-2012 © Qiming Zhou GEOG3600. Geographical Information Systems GIS Data Modelling

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