CHP 6 Managing Raster Data
CHP 6 Managing Raster Data
2
Examples of rasters
Sources: USGS (a, c, e); Black Hills National Forest
(d); Esri (b,f) a) Digital Elevation Model
(DEM)
b) color aerial photograph
c) land use categories
d) primary, secondary,
and primitive roads
e) scanned topo map, or
Digital Raster Graphic
(DRG)
f) ArcGIS Online basemap
tile
3
Raster data structure
➢Dividing space into discrete uniform units-square cells,
namely a cellular model of geometry.
➢Location is inherent in the storage structure, namely,
implied by row and column number of the grid cell
rather than through the use of explicit spatial
coordinates.
➢Raster data structure does not provide precise
locational information.
➢Two-dimensional array of grid cells is called a layer, a
grid, or a band in different contexts.
➢Each layer of raster data is often used to represent a
particular topic (theme).
6-4
Spatial resolution of raster
data
➢The cell must be small enough to capture the
required spatial detail.
➢Resampling to large cell size (low resolution) will
cause losing some of the small spatial features. But
down-sampling from large cell size to small cell size
won’t increase the data resolution!
➢Reducing the grid cell size to half the current size
will increase the data volume four times.
➢Store one number for every sq m, 1 Pb (trillion
bytes) www.ccsf.caltech.edu/~roy/dataquan/
Grid
cell
Rows
Resolution
6-6
Pixels/Cells
• Each pixel contains one
numeric value
• The dimensions of a pixel is
the resolution
• Value represents some
property of that pixel area,
e.g. elevation or rainfall
• Values may be integers or
floating point numbers
• Unlike a polygon, each cell has
only ONE attribute; storing
multiple values requires
storing multiple rasters
© 2020 McGraw-Hill Education. 6-7
Raster resolution
Source: Black Hills National Forest
6-9
6-10
Pixel depth
Pixel depth is the number of bytes used for each pixel
• More bytes = larger numbers = more space.
Integer values
• 8-bit pixel (one byte) stores 28 values from 0 to 255.
• 16-bit pixel (two bytes) stores 216 values from 0 to 65,565.
• 24-bit pixel (three bytes) stores 224 values from 0 to 16.7
million.
Floating point values
• Required for decimal number storage.
• Uses a 32-bit pixel (four bytes).
• Includes the mantissa (significant figures) and an exponent.
• 1.2345678 × 103.
6-11
Change the raster pixel depth and
type
• Use "Copy Raster"
• Select a pixel type from the
list
• The new raster data set will
have the defined type
• Warning: converting a
floating point type to an
integer type will cause loss
in the precision of raster
values.
• For example, 2.533 -> 2 will
lose three significant digits.
12
Bands
15
Discrete rasters
Sources: USGS (c); Black Hills National Forest (d)
• Discrete rasters store categorical
data such as land use (c), or
features such as roads (d)
• Many discrete rasters are
converted from vector points,
lines, or polygons
• Unlike vector data that can store
many attributes for each feature,
discrete rasters can only store
one attribute
• Digital raster graphic (DRG) is
the scanned product of US
Geological Survey topographic
maps.
16
Raster pyramids
Source: Esri
• Pyramids may be
built for a raster to
speed its display
• Successively lower
resolution copies are
created by
representing four
adjacent cells as a
single pixel
• Each copy is efficient
for different scales of
display
• Building the
pyramids takes a
6-17
little time and
Resampling
6-19
Resampling methods (2 of 2)
Block resampling
groups pixels and
determines the new
value using a statistic
This pyramid uses block
resampling with the
majority statistic
Other rules such as
minimum, mean, or
maximum can also be
used
6-21
Raster tables Attribute tables are created
for discrete rasters with a
Source: Esri
limited number of unique
values
● The Value field contains
each unique value.
● The Count field
indicates how many cells
have that value.
● Explanatory fields, for
example the geology
units names from the
original polygon data set,
may also be included.
● Not all raster datasets
have a value attribute 6-22
NoData NoData is a special value
used in some raster formats
Source: USGS
to indicate absent data
Often replaced by zero in
other formats, but not as
satisfactory
• Zero is a valid precipitation
measurement, for example
(it didn’t rain).
Rasters are always
rectangular
• This DEM has NoData
values outside of South
Dakota.
6-23
BIP, BIL, and BSQ formats
• Multiband raster data can be stored in different formats
• Most common formats are JPEG, TIFF, BMP, Erdas
Imagine image
• ArcGIS has the File Geodatabase Raster (FGDR)
• Raw formats: Band Interleaved by Pixel (BIP), Band
Interleaved by Line (BIL), and Band Sequential (BSQ)
6-24
Header file for BIL, BIP, and BSQ
• BIL, BIP, and BSQ data are comprised of two files: an
ASCII header file (*.hdr) and a binary data file (*.bil,
*.bip, or *.bsq)
• Header files are provided with BIL, BIP, or BSQ files
• The file extension is .hdr
• Keywords are: nrows, ncols, bands, nbits, pixeltype,
byteorder, ulymap, ulxmap, xdim, ydim, bandrowbytes,
etc.
Sample BIL header file
Lines that don't begin with a keyword are treated as
comments.
nrows 1024 Comments can be placed here as well.
ncols 1024
nbands 3
6-25
nbits 8
Example of a BIL raster
nrows 8
ncols 8
nbands 3
layout bil
26
ASCII Raster
• Rasters can be presented in texts
• A header part shows the information of the raster
• Data part contains an array of values with each number
representing on pixel/cell of the raster
• Save as *.asc file
NCOLS xxx
NROWS xxx
XLLCENTER xxx
YLLCENTER xxx
CELLSIZE xxx
NODATA_VALUE xxx
row 1
row 2
...
row n
6-27
Compression
• Many raster formats use compression to reduce storage size
• Run-length encoding (RLE) is used for discrete rasters and
stores how many times each adjacent value appears
• It is called reversible or lossless because the original can be
recovered.
• LZ77 is a generalized RLE
(0 1 1 1 1 1 3 3 3 3 3 3 5 5 5 5 5 5 7 8) to (01 15 36 56 71 81)
6-29
Raster coordinate systems
Source: USGS
6-31
Georeferencing rasters
Source: Esri
35
Draping an image on an elevation
model
1. Insert a new local scene
2. Add the image to be
displayed
3. In "Elevation Surfaces",
right click and select create
surfaces from sources and
select the elevation data as
the source
4. Right click the image layer
and check the properties of
it.
5. In the elevation tab, set the
Elevation as "Features are
On custom elevation
surface"
6. Select custom surface as
the new surface you just
36
created from the source
Extruding a polygon data with a 3D
field
• Insert a new local scene
• Add the polygon data to the
map
• In Featurelayer ribbon and
Extrusion tab, select type
as " min height"
• Set field as an expression,
such as pop2014 / 10
• The polygons will be
extruded as 3D objects
37
Point clouds
Source: Esri
• A triangular
irregular network
(TIN) stores x,y,z
triplets (nodes) that
define the corners of
triangular facets
bounded by linear
edges
• TINs efficiently store
3D surfaces by using
fewer nodes for flat
areas and more nodes
for steep areas
6-39
Space time cube
Source: Esri, USGS
6-40
Creating a space time cube
Source: Esri A correctly formatted
Date/Time field is required
This data set contains
earthquakes over a 36 hour
period, with magnitudes, to be
aggregated in 6 hour time
steps
A rectangular or hexagonal
grid, with specified size, may
be selected
Choose the field(s) to be
aggregated in the grid/time
step interval
The standard netCDF data 6-41