0% found this document useful (0 votes)
64 views19 pages

2021 L5 GGY283 Data Models 2

ggy283

Uploaded by

Fanelo Felicity
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views19 pages

2021 L5 GGY283 Data Models 2

ggy283

Uploaded by

Fanelo Felicity
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

2021/03/26

GGY 283
Theme 2 – Data models cont.
L5 – Data models Part 2

©2021

Introduction to GIS - Copyright reserved 1

Theme 2 – Relevant texts


Prescribed
1. Bolstad - Chapter 2

Recommended
1. Di Biase – Chapter 1
2. De Smith et.al. – Chapter 2
3. Essentials of GIS - pp 61-70, 76-93, 104-106.
4. GIS Commons. Chapter 1 and Chapter 2 no. 1-4
5. Olaya, V. – p25 to 36;
6. Sutton et.al. - Topics 2,3,5 and 6.

Introduction to GIS - Copyright reserved 2

1
2021/03/26

Spatial Data Models cont.


Study goals (L5)
• Explain how the raster data model represents real world phenomena in a GIS.
• Discuss the importance of spatial resolution in raster data
• Describe how spatial and attribute data are linked in a raster data model
• Compare the advantages and disadvantages of raster and vector data models
• Discuss the conversion of data between the two data models
• Discuss the use of TIN models in a GIS
• Discuss the use of DEM models in a GIS
• Explain the difference between TIN and DEM models
• Name and discuss the common data structures and file formats used to store GIS data
• Explain the concept of raster data compression and differentiate between Loss less and Lossy
compression schemes.

Introduction to GIS - Copyright reserved 3

Review from L4: Spatial Data Models: Vector and Raster models

Source: Vector vs raster Data Model


images – NewDesignfile:
http://www.newdesignfile.com/post_ve
ctor-vs-raster-data-model_377805/

Introduction to GIS - Copyright reserved 4

2
2021/03/26

Raster data models


Raster data layers in GIS are made up of a matrix of (cells also called pixels) arranged in rows and
columns. Each cell contains a value that represents the conditions for the area covered by that cell.

Source: QGIS documentation


Introduction to GIS - Copyright reserved 5

Raster cells and Attribute information


Raster attribute tables can be stored in different ways.
Note: In QGIS, the attribute table of raster data is hidden, but you can view the value of a
cell by clicking on it.
Examples
Many to 1 relationship
1 to 1 relationship
Prominent in GIS software
Each cell has a record in the table
Raster cell values Raster cell values
Grouping cells with similar values

Smaller /
compact table
Large table is created

Source: Bolstad,
Introduction Chapter
to GIS - Copyright 2
reserved 6

3
2021/03/26

Example:
A raster attribute table:
many-to-one relationship

M :1 in ArcView

Introduction to GIS - Copyright reserved 7

Conversion of Spatial Data between data models


• Vectorization is the process of converting raster data
into vector data. The reverse is called rasterization
Vector objects

Vector -to- raster


Raster -to- vector

Raster cell objects

Image source: Vector vs


raster Data Model images –
NewDesignfile:
http://www.newdesignfile.
Introduction to GIS - Copyright reserved
com/post_vector-vs-raster-
8
data-model_377805/

4
2021/03/26

Vector –to- Raster Conversion Process


• Line/boundary segments are transformed into cells and coded accordingly
Cell value
r r r

r r

r r

• Raster cells may be coded using different rules. e.g.

Vector line Vector line

First rule option Second rule option


Any cell that touch Defined sub-cell distance
Result: More adjacent cells Result: Fewer adjacent cells
Introduction to GIS - Copyright reserved 9

Class activity 1: Vector to raster conversion


What may be the impact of a chosen conversion rule?

Two vector lines Any cell rule Near cell center rule
Introduction to GIS - Copyright reserved 10

5
2021/03/26

Explore vector to raster conversion:


What may be the impact of the size of the pixel chosen?

Two vector lines Smaller cells (any cell rule) Larger cells (any cell rule)
Introduction to GIS - Copyright reserved 11

Note:
When using raster data there is a Trade-off between
the number and size of cells versus the accuracy and level of detail that can be achieved.

Introduction to GIS - Copyright reserved 12

6
2021/03/26

Vectorization
• Takes an entire raster file and converts it into vector objects..
Raster cells Define coordinates Vector set

• Challenges:
Source: Bolstad, Chapter 2
- vectorized entities may become over-defined
- result may have a jagged appearance and/or larger extent
- may take long to complete the process
• Solution: data are normally smoothed & filtered

Introduction to GIS - Copyright reserved 13

Raster Data: Resolution


• The cell dimension (size) represents a real world area.
• A user defines the cell dimension [l x w ] – also called “spatial resolution”
Difference: Higher vs Lower spatial resolution Raster dataset
 Low / coarse resolution: Larger cells, less accurate location, less detail, but
smaller data sets (less cells have to be stored).
 High / fine resolution: Smaller cells, spatial location may be more ‘accurate’,
more detailed but data sets is bigger (because more cells must be stored)

Lower
resolution Higher
resolution

Example:
Landto cover
Introduction features
GIS - Copyright reserved 14

7
2021/03/26

Advantages of Raster data:


• Has a simple data structure & Easily updated”.
• Remote sensing imagery is typically obtained in raster format.
• Allows various easy analysis methods.
• Effectively stores continuous data.

Find more examples here:


http://planet.botany.uwc.ac.za/nisl/GIS/GIS
_primer/page_19.htm

Introduction to GIS - Copyright reserved 15

Disadvantages of Raster
Different resolutions
Lower resolution may result in
- Spatial inaccuracies
Spatial resolution

- Generalization of the landscape

• Boundaries are not precise.


• Each cell must have a code even if there is
nothing of interest in the cell – this results in large
data sets.
• Large datasets – need more storage space Level of accuracy and detail
• Large datasets - may cause longer processing Graph illustrating the relationship between
times spatial resolution and the level of accuracy
• Difficult to create network links or topology of and detail that can be achieved. E.g. The
any kind higher the spatial resolution, the better the
accuracy and detail.
Find more examples here:
http://planet.botany.uwc.ac.za/nisl/GIS/GIS_primer/page_19.htm

Introduction to GIS - Copyright reserved 16

8
2021/03/26

Typical Examples of Raster data


• Satellite imagery Digital image

-E.g. Landsat data, SPOT data


• 3 D spatial models
- E.g. Digital Elevation Models Land Surface

(DEM)
• Scanned maps
• Aerial imagery – aircraft / drones
Cover large areas
- e.g. aerial photographs
• Converted data (Vector to raster)

Introduction to GIS - Copyright reserved 17

Raster images versus other raster data files


Satellite images and aerial photographs are examples of Raster cells can be used to show other trends or features
images that depict the real world surface using raster cells in an area. Each cell in the raster represents a different
(pixels). Sometimes it is just a picture, bit some images value e.g. average rainfall, or average elevation or risk
may have different bands with spectral values (more about factors, etc.
this later)

Source: Sutton et.al. p52 True colour raster images (left) are useful as they provide a lot of detail that is hard to capture as vector
features, but easy to see when looking at the raster image. Raster data can also be non-photographic data such as the raster layer
shown on the right which shows the calculated average minimum temperature in the Western Cape for the month of March.
Introduction to GIS - Copyright reserved 18

9
2021/03/26

Digital terrain models


Two models often used in GIS to represent terrain
(elevation, steepness of slope and direction of slope)
• TIN (Triangulated Irregular Network) a set of adjacent,
non-overlapping triangles with x, y coordinates and z
vertical elevations for their vertices, along with topological Source:
relationship between the triangles and their adjacent Bolstad,
neighbours. Chapter 2

• DEM (digital elevation model): raster grid cells based on a


set of sampled ground points in the x and y dimensions
accompanied by an elevation measure (z dimension).

Introduction to GIS - Copyright reserved 19

Triangulated Irregular Network (TIN) basics

• Typically the x, y, and z locations for measured points are


entered into the TIN data model.
• Points are connected so that the smallest possible triangle is
created.

Introduction to GIS - Copyright reserved 20

10
2021/03/26

Triangulated Irregular Network (TIN)


Extract from Sutton et. al. p97-98
“A common TIN algorithm is called Delaunay triangulation. It attempts to create a
surface formed by triangles of nearest neighbour points. Circles around selected
sample points are created and their intersections are connected to a network of non
overlapping and as compact as possible triangles.”

TIN applications – usefulness


Can be used to derive slope, aspect, hydrological functions…

Introduction to GIS - Copyright reserved 22

11
2021/03/26

Sample points - Triangulated Irregular Networks

Fewer points necessary when the


terrain is flat/smooth
and
more points (higher density)
required when the terrain is highly
variable.

Source:
Bolstad,
Chapter 2

Introduction to GIS - Copyright reserved 23

Digital Elevation Model (DEM)


• Raster model of the landscape terrain (also known as height-map)
Zoomed-in Large area, e.g. SA
(Continuous surface)
i.e. Bare ground
surface

Elevation values (m)


Source: Bolstad, Chapter 2

• Usually generated from sample points


(i.e. x, y and z values).
• Resolution is a critical parameter.
• Useful for determining attributes of terrain,
such as elevation at any point, slope and aspect.
• Identifying features based on terrain characteristics e.g. drainage
basins and watersheds, rivers and streams.
Introduction to GIS - Copyright reserved 24

12
2021/03/26

DEM Applications – typical uses

Source: https://giscommons.org/analysis/

Introduction to GIS - Copyright reserved 25

Object data models


Bolstad (p 55-57)

• Object data models – a more recent “new” way of structuring spatial data.
• Combine the properties of objects with their behaviour (rules) .
• Often follow a “logical model” e.g. owners have properties, properties “belong
to” a municipality.
• Entities are represented as object with properties, behaviour, relationships &
topological rules.
• Relationships and rules are stored in a database which can be transparently
modified.
• Object types may include simple objects, geographic features (objects with
location), network features, annotation features, etc.
• Generic tools for object data models are not yet readily available.

Introduction to GIS - Copyright reserved 26

13
2021/03/26

Typical file formats used to store GIS data


File formats are
• adopted by governmental departments or agencies
• or based on formats specified by software vendors.
Common GIS file formats:
Formats

Single band
Raster Multiple band
Extension Description

Vector shapefile .shp


.dbf
Stores the geometry of vector features
Stores the attributes of vector features Source: Sutton, Topic 4
is made up of at least .shx An index to speed up searches
three files, e.g. .prj Added if the data is projected

.dbf (compatible with e.g. ArcGIS, Arcview, Ms Excel etc.)


Attribute .mdb (Microsoft Access)
‘Container’ types .gpkg (QGIS Geopackage)
Introduction to GIS - Copyright reserved 27

Examples of
Raster and
Vector file
formats
Reading
for future reference
Sources:
Bolstad, Chapter 2
Sutton, Topic 4
Essentials, p 63

and
.JPEG (little distortion
on image quality

Introduction to GIS - Copyright reserved 28

14
2021/03/26

Data Compression
Why are data compression techniques often required for raster data sets?
• Because raster data sets are generally very big – data compression techniques are used
to reduce the file size.
• The aim is to reduce the file size without losing important information.
• Efficient raster image compression helps to reduce storage space.
• Compression may also improve network performance.
Explore one or more of the following examples:
https://gisgeography.com/image-compression-encoding/

http://www.gitta.info/DataCompress/en/html/rastercomp_chain.html

https://www.kau.edu.sa/Files/0053593/files/33286_GIS%20Lecture%20Six-1.pdf

http://iieng.org/images/proceedings_pdf/6776E0314195.pdf

Introduction to GIS - Copyright reserved 29

Example: Raster data compression using


Run – length encoding
Simple compression method – “run – length encoding” for image compression
Replaces a sequence of identical values v1, v2, . . ., vn by a pair of values (v,
n). Note that there are various compression schemes of this type.

Eg. The “Cell by cell” uncompressed data for the raster data set below
(255 255 255), (255, 0, 0), (255, 255, 255), (255, 0, 0), (255, 255, 255),
can be compressed as:
→ 255:4, 0:2, 255:4, 0:2, 255:3
255 255 255
Or row by row
255 0 0 r1 255:3
255 255 255 r2 255:1, 0:2
r3 255:3
255 0 0
r4 255:1, 0:2
255 255 255 r5 255:3

Introduction to GIS - Copyright reserved 30

15
2021/03/26

Example – Variable length encoding


• Simple compression method - “variable length code sets” -
for text compression
Letter 4 bit encoding Variable length encoding
A 0000 00
I 0001 10
H 0010 010
W 0100 110

HAWAII→ 0010, 0000, 0100, 0000, 0001, 0001


compressed to → 010, 00, 110, 00, 10, 10

Introduction to GIS - Copyright reserved 31

Data compression ratio


• Compression ratio =
size of the uncompressed data / size of the compressed data

– Measures how much compression schemes reduce storage


requirements of data
– Indicates the amount or degree of reduction of the raster file size.
– Expressed as the ratio of its original size to the new size:
• for example if a file was 20 MB and after compression it is 2 MB the
compression ratio equates to a 10:1

Introduction to GIS - Copyright reserved 32

16
2021/03/26

Types of compression
• Lossless compression schemes
– No information is lost in the compression.
– It is possible to exactly reproduce the original data.
• Lossy compression schemes
– Do not guarantee that all of the information in the original data
can be fully and completely recreated.

Introduction to GIS - Copyright reserved 33

Summary:
Common Vector / Raster data model characteristices
Factor Vector Raster
Data structure Can become complex Usually simple rows and columns
Positional accuracy Can be very accurate – but depends on Depends on the cell size, but it is normally
the measurement method and tool less accurate.
Storage requirements Normally much smaller than raster data Generally requires significantly larger
sets storage space than vector data.
Processes like coordinate Fast and simple May be slow and may require resampling
transformations procedures
Spatial analysis procedures Spatial analysis operations can become Simple procedures once the data layers
very complex have the same resolution and origin.
Encoding and programming More complex – requires more input Easier due to simpler data structure
Display and visualisation Very good for presenting continuous data Good for displaying discreet features like
and images, but discreet structures may boundaries, rivers and roads but mostly not
show rugged or “step-like” boundaries suitable for images or continuous data
Introduction to GIS - Copyright reserved 34

17
2021/03/26

Assess your knowledge and understanding


Using examples and in your own words, can you explain the following to someone?
• How a raster data model represents real world entities in a GIS.
• How spatial and attribute data in a raster model can be linked
• The typical types of raster attributes that can found in a raster model.
• What spatial ‘resolution’ refers to in a raster dataset.
• The effect of raster resolution on the level of accuracy and detail achievable in a raster dataset.
• Typical raster data sources.
• The conversion of data between vector and raster data models – how it is achieved and the
possible impact of the conversion on data accuracy and precision.
• The advantages and disadvantages of raster and vector data models.
• The most common data structures and file formats used to store GIS data.
• Why data compression may be required and how the compression ratio can be measured.
Introduction to GIS - Copyright reserved 35

References
• Bernhardsen, 2002. Geographic Information Systems an Introduction 3rd Edition
• Bolstad, Paul. 2012: GIS Fundamentals, A First Text on Geographic Information
Systems, Chapter 2.
• Clark, 2003. Getting Started with Geographic Information Systems 4th Edition,
• Chang, 2004. Introduction to Geographic Information Systems 2nd Edition
• Creative Commons. (2011) Essentials of Geographic Information Systems.
• Sutton, T. Dassau, A and Sutton, M., 2009. A Gentle Introduction to GIS.
• Various online sources as indicated in the relevant slides.

Introduction to GIS - Copyright reserved 36

18
2021/03/26

WHAT IS NEXT?
Theme 2 – Lecture 6: Data models Part 3

If you have any questions!


Use the GIS chats discussion board on clickUP

Introduction to GIS - Copyright reserved 37

19

You might also like