Raster Data
G.M.W.L. Gunawardena
Department of Town and Country Planning
Spatial Data Models
• Raster
Uses individual cells in a
matrix, or grid format to
represent real world
entities
A Few Synonyms for Raster
• GRID – the ArcInfo raster type
• Image (generic) – usually relates to satellite imagery
• Image (.img) – Raster data structure used by Erdas
Imagine, a common image-processing software package
• Array – more technical term associated with how raster
data are managed by computer programmers
• Matrix – rarely used because of it’s association with
mathematics, but it does occasionally come up
Elements of Raster Data Model
• Cell value - Each cell in a raster carries a value, which represents the
characteristic of a spatial phenomenon at the location denoted by its row
and column. The cell value can be integer or floating-point.
• Cell size - The cell size determines the resolution of the raster data model.
• Raster bands - A raster may have a single band or multiple bands.
• Spatial reference - Raster data must have the spatial reference information
so that they can align spatially with other data sets in a GIS.
Types of Raster Data
Discrete raster: land use Continuous raster: DEM
Discrete raster: roads Continuous raster: image
Continuous Data
• Raster is the best way to store
continuously changing values such
as elevation
• Analysis faster and more flexible
than vectors for many applications
• Some analysis only possible using
rasters
Raster Analysis Functions
Distance Interpolation
Density
Least cost path
Viewshed
Buffers 1-7
Cell Size & Resolution
• The size of the cells in the raster data model
determines the resolution at which features can be
represented
• The resolution can have an effect on which features
are represented in what locations:
10 m Resolution 5 m Resolution 1 m Resolution
Impact of Resolution
90m resolution • Storage space increases
by the square of the
resolution
• Portraying large areas at
high precision is
10m resolution problematic
Raster Data Model - Points
1 point = 1 cell
+
+
+
+
What problems do we have here?
• 2 points in single pixel
• Point on the boundary between 2 or more cells
Raster Data Model - Lines
A line = a series of connected cells that portray length
Problems with this representation?
• Lines may be narrower than pixels show
• Curved lines can loose detail (e.g., if the curves are
smaller than the pixel resolution can detect)
Raster Data Model - Areas
Area = a group of connected cells that portray a shape
What problems could we have with this representation?
• What if a lake’s edge falls in a pixel?
• Area calculations loose accuracy
Raster and Vector Data Model Comparison
Real World Features Raster Vector
•
•
•
Raster File Formats
https://pro.arcgis.com/en/pro-
app/2.8/help/data/imagery/supported-raster-dataset-file-
formats.htm
Rules for Assigning Cell Values
Cell values can be assigned to cells according to some set of rules,
and selecting those rules differently can also effect the representation
of features:
“Boundary Problem” Handled by Mixed Pixels
Effect of a raster representation using: (A) the largest share
rule
(B) the central point rule
Raster and Vector
Flat File
Vector-based line
4753456 623412
4753436 623424
4753462 623478
4753432 623482
4753405 623429
4753401 623508
4753462 623555
4753398 623634
Raster-based line Flat File
0000000000000000
0001100000100000
1010100001010000
1100100001010000
0000100010001000
0000100010000100
0001000100000010
0010000100000001
0111001000000001
0000111000000000
0000000000000000
COMPARISON OF Raster & Vector
Attribute Raster Vector
Volume of Data Depends on cell size Depends on density of
vertices
Sources of data Remote sensing, Socio-economic,
imagery environ. sampling
Applications Environmental Socio-economic,
administrative
Software Raster GIS, image Vector GIS,
processing Cartography
Resolution Fixed Variable
Raster Data Model - Storage
• There is a trade-off between spatial resolution and
data storage when we use the raster data model,
e.g.
• 60 km satellite image with 10m cell size
• 6000 X 6000 = 36,000,000 cells
• 1 byte of attribute value
• ~36 MB of disk storage!
• 60 km satellite image with 100m cell size
• 600 x 600 = 360,000 cells
• 360 KB of data…
Compression and Encoding of Raster Data
• Small cell size – more data record
• Small cell size – high storage capacity
Raster Data Storage – No Compaction
This approach represents each max. cell value
cell individually in the file: rows
columns
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 1 1 1 0 0 10, 10, 1
0 0 0 0 1 1 1 1 0 0 0000000000
0 0 1 1 1 1 1 1 0 0 0000000000
0 0 1 1 1 1 1 1 0 0 0000111100
0 0 1 1 1 1 1 1 0 0 0000111100
0 0 1 1 1 1 1 1 0 0 0011111100
0 0 0 0 0 0 0 0 0 0 0011111100
0 0 0 0 0 0 0 0 0 0
0011111100
0011111100
0000000000
Problem: too much redundancy 0000000000
103 values
Raster Data Storage –
Run Length Encoding
This approach takes advantage of patterns in the data, taking
advantage of the repetition of values in a row:
0 0 0 0 0 0 0 0 0 0
header 10,10,1
0 0 0 0 0 0 0 0 0 0
0, 10
0 0 0 0 1 1 1 1 0 0 0, 10
0 0 0 0 1 1 1 1 0 0 0, 4, 1, 4, 0,2
0 0 1 1 1 1 1 1 0 0
row 0, 4, 1, 4, 0,2
0 0 1 1 1 1 1 1 0 0
by 0, 2, 1, 6, 0,2
0 0 1 1 1 1 1 1 0 0
0, 2, 1, 6, 0,2
0 0 1 1 1 1 1 1 0 0
row 0, 2, 1, 6, 0,2
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0, 2, 1, 6, 0,2
0, 10
0, 10 45 values
There is a tendency towards spatial autocorrelation; for nearby
cells to have similar values - values often occur in runs across
several cells
Raster Data Compression Models:
Block Encoding
Run-length encoding in 2-D: Uses a series of square blocks to encode
data
From An Introduction to Geographic Information Systems, Heywood et al. (2002)
Raster Data Compression Models:
Raster Chain Codes
Reduces data by defining the boundary of entity
From An Introduction to Geographic Information Systems, Heywood et al. (2002)
Raster Data Compression Models: Quadtrees
–Recursively divides an area into four quadrants until all the quadrants (at all levels)
are homogeneous
Raster Data Compression Models:
Quadtrees Example
ROOT
1 1 2 2
1 1 2 2
3 3 2 2 NW NE SE SW
? ? ?
3 3 3 3
? ? ? ?
ROOT
1 1 2 2
1 1 2 2
3 3 2 2 NW NE SE SW
1 2 3
3 3 3 3
2 2 3 3
Raster Data Model - Advantages
• The data structure is much simpler
• It is easy to overlay and combine layers
• It is easy to apply equations to the entire surface (map
algebra)
• Example: New GRID = GRID_1 + GRID_2
• Raster data is easily integrated with satellite (and other
remotely-sensed) data
• Writing programs to manipulate raster is easier
• It is easy to do simulation modeling due to uniform size
and shape of grids (i.e. it is easy to define uniform
modeling units)
Raster Data Model - Disadvantages
• Because a value must be stored for each and every cell
in a grid, there is a great deal of redundancy and large
storage requirements
• Location can be captured only as accurately as the
resolution allows, which is determined by the cell size
• Spatial analyses that are based on topological
relationships are not well supported by this model
• Changing resolution (i.e., cell size) can be complicated
Thank You