Upload
jerome-hawkins
View
217
Download
0
Tags:
Embed Size (px)
Citation preview
Copyright © 2006 by Maribeth H. Price
15-1
Chapter 15
Raster Analysis
Copyright © 2006 by Maribeth H. Price
15-2
Outline
• About rasters
• The grid raster format
• Raster analysis basics– Map algebra– Boolean overlay– Other raster functions
• Using Spatial Analyst
Copyright © 2006 by Maribeth H. Price
15-3
Outline
• Differences between the raster and vector data models and the benefits and drawbacks of each
• Basic facts about the storage and use of the grid data model
• Getting familiar with basic raster analysis functions
• Using Boolean map algebra to perform overlay analysis with rasters
• Controlling the analysis environment when using Spatial Analyst
• Using Spatial Analyst for raster analysis
Copyright © 2006 by Maribeth H. Price
15-4
The raster data model
Rows
ColumnsX, Y location
Raster data fileN rows by M columns
X, Y location
Georeferenced to earth’s surface
Copyright © 2006 by Maribeth H. Price
15-5
Types of raster data
Discrete raster: land use
Continuous raster: DEM
Continuous raster: image
Discrete raster: roads
Copyright © 2006 by Maribeth H. Price
15-6
Raster Properties
Scroll down for more info
Copyright © 2006 by Maribeth H. Price
15-7
Raster vs Vector models
• Raster strengths– Simple, robust format– Implicit georeferencing– Storage of continuous
data– Surface analysis– Faster analysis
• Raster drawbacks– Storage space– Lower precision
• Vector strengths– Coordinate precision– Attribute management– Storage space– Flexible cartography
• Vector weaknesses– Surface analysis– Continuous data
storage
“Raster is faster, but vector is correcter.”
Copyright © 2006 by Maribeth H. Price
15-8
Raster resolution
• Measured by cell size
• Storage space increases dramatically with precision
Vector format 200 m raster 50 m raster
Copyright © 2006 by Maribeth H. Price
15-9
Raster formats
• Grids– Special format for Spatial Analyst– Required to perform analysis– Integer or floating-point values
• Other formats– JPEG, TIFFs, MrSID, etc.– For display only
Copyright © 2006 by Maribeth H. Price
15-10
Naming grids
• Names must be 13 characters or less
• Do not use spaces or non-alphanumeric characters to name grids
• No spaces in folders or grids– (underscore is OK)
Remember. No spaces.
Copyright © 2006 by Maribeth H. Price
15-11
Managing grids
• Working directories tend to get clogged with grids after a while and will need to be cleaned out
• Grids have complex data format
• Copy, move, and delete grids ONLY with ArcCatalog!!!!
Copyright © 2006 by Maribeth H. Price
15-12
Grid attribute tables
• Created for discrete integer grids only
Geology
Copyright © 2006 by Maribeth H. Price
15-13
Converting features to raster
Choose one attribute
Grid valueText attribute carried over
Copyright © 2006 by Maribeth H. Price
15-14
Converting raster to features
Convert only discrete data without too many polygons
To complex to convert
OK to convert
Copyright © 2006 by Maribeth H. Price
15-15
NoData
• Specific grid value to indicate lack of data
• Often replaced by zero in other formats
• Used to create masks
NoData
NoData
Copyright © 2006 by Maribeth H. Price
15-16
Georeferencing rasters
Rows
Columns
x,y location
Raster data fileN rows by M columns
x,y location
Georeferenced to earth’s surface
Copyright © 2006 by Maribeth H. Price
15-17
Georeferencing of images
• Some raster data comes already georeferenced, with an assigned coordinate system.– Landsat image– Digital elevation models– Digital map products from the
USGS
• Other rasters have no georeferencing and must be prepared before use– Scanned maps or photos,
pictures grabbed from Web
Copyright © 2006 by Maribeth H. Price
15-18
The Georeferencing toolbar is used to link image locations to corresponding locations in an already georeferenced data set. After the links are established a final georeferenced map can be produced.
Copyright © 2006 by Maribeth H. Price
15-19
Raster analysis
• Basic concepts
• Map Algebra
• Boolean overlay
Copyright © 2006 by Maribeth H. Price
15-20
Map Algebra
• Rasters are essentially arrays of numbers
• Can be added, subtracted, etc
• Line up matching cells vertically
5 7
2 4
3 2
1 6
8 9
3 10
Ingrid1
+
Ingrid2
=
Outgrid
Fig. 15.4. Map algebra
Copyright © 2006 by Maribeth H. Price
15-21
Map Algebra expressions
• Convert precipitation in cm to inches– [Precip] / 2.54
• Compute earth volume to be moved– [InitialSurface] – [Finalsurface]
• Enter models based on multiple inputs
[Precip] * 2 + [Slope] * 4 / ( [Erode] – [Vegcover]
• Logical expressions– [Elevation > 1400]
Copyright © 2006 by Maribeth H. Price
15-22
Conversions
[Precip_cm] / 2.54
Precip in cm Precip in inches
Copyright © 2006 by Maribeth H. Price
15-23
Cut and fill on a site
[Initial surface] – [final surface]
Cut
Fill
Copyright © 2006 by Maribeth H. Price
15-24
Model expressions
Complex expressions with multiple inputs to calcuate risk or hazard index.
Runoff in cm based on four input grids: precip, slope, soil infiltration, and vegetation cover.
[Precip] * 2 + [Slope] * 4 / ( [Erode] – [Vegcover]
Copyright © 2006 by Maribeth H. Price
15-25
Logical expressions
• Produce a Boolean grid of 1’s and 0’s– 1 = True– 0 = False
[EarthMove] > 0
1
0
Elevation > 14001
0
Copyright © 2006 by Maribeth H. Price
15-26
Boolean expressions
A AND B
A XOR B A NOT B
A OR B
A B
0
1
Blue circles represent areas where condition holds
(True) = 1
Copyright © 2006 by Maribeth H. Price
15-27
Boolean Map Algebra
True (1)False (0) A AND B A OR B A NOT B A XOR B
InputsA
B
Output
Compare values of corresponding cells and determine output value
Copyright © 2006 by Maribeth H. Price
15-28
Boolean overlay using map algebra
0
11
0
11
0
11
AND =
Find intersecting areas where all conditions are true to determine lodgepole habitat. Equivalent of vector Intersect
Copyright © 2006 by Maribeth H. Price
15-29
Another way to look at Boolean intersection
0
11
0
11
0
11
x =
Boolean AND is equivalent to multiplication. So multiplying layers works just as well.
1 AND 1 = 1
1 AND 0 = 0
0 AND 1 = 0
0 AND 0 = 0
1 × 1 = 1
1 × 0 = 0
0 × 1 = 0
0 × 0 = 0
Copyright © 2006 by Maribeth H. Price
15-30
Additive Boolean overlay
0
1
2
0
11
0
11
+ =
Instead of multiplying, add the layers together to create a ranked probability result.
Copyright © 2006 by Maribeth H. Price
15-31
Other raster analysis techniques
• Reclassification
• Surface functions
• Distance functions
• Density functions
• Interpolation
• Neighborhood functions
• Zonal functions
Copyright © 2006 by Maribeth H. Price
15-32
Reclassify
Convert one set of grid values to another
Manual or classify
Slope High slope/low slope
Copyright © 2006 by Maribeth H. Price
15-33
Surface analysis
DEMSlopeAspectHillshadeContouring
Copyright © 2006 by Maribeth H. Price
15-34
Viewshed analysis
• Areas visible from a set of observation points
Copyright © 2006 by Maribeth H. Price
15-35
Distance functions
Straight line distance
Cost path distance
Buffers
Copyright © 2006 by Maribeth H. Price
15-36
Lowest cost path1. Create start/stop
shapefiles
2. Create cost grid
3. Calculate cost distance grid and cost direction grid
4. Find lowest cost path
Elevation Slope
Cost distance Cost direction
Copyright © 2006 by Maribeth H. Price
15-37
Density
• Calculate from point distributions
Copyright © 2006 by Maribeth H. Price
15-38
Interpolation
• Estimate gridded values between known points
• Three options– Inverse distance
weighted– Kriging– SpliningRainfall grid from
weather station data
Copyright © 2006 by Maribeth H. Price
15-39
Neighborhood functions
Output gridInput grid
3 1 4
6 2 1
5 4 3
3 1 4
4
1
3
4
3 1 4 4
1
2
4
1
1
2.0 2.5 3.4 2.8 3.6
3.8 3.2 2.9 3.0 2.3
3.1 3.3 2.5
WindowTarget cell
Averaging function
Copyright © 2006 by Maribeth H. Price
15-40
Neighborhood majorityHigh slope/low slope areas
Before 5x5 majority filter After two passes of 5x5 majority filter
Useful for simplifying rasters prior to conversion to polygons
Copyright © 2006 by Maribeth H. Price
15-41
Cell statistics
Calculate statistics for a stack of grids
Copyright © 2006 by Maribeth H. Price
15-42
Zonal statistics
• Zones defined by a layer
• Value grid
• Calculates value statistics for each zone
Watersheds
Average slope
Copyright © 2006 by Maribeth H. Price
15-43
Using Spatial Analyst
• Executing functions
• Temporary vs permanent output grids
• Resampling and coordinate systems
• Analysis environment options– Workspace– Extent– Cell size– Masks
Copyright © 2006 by Maribeth H. Price
15-44
Menu tools
• Most commonly used functions are in the Spatial Analyst toolbar
• More functions can be found in ArcToolbox
• Some tools are slightly different than the menu tool—may have more or different options
Copyright © 2006 by Maribeth H. Price
15-45
ArcToolbox
• Hundreds of additional functions found in ArcToolbox
• Use them in scripts and models if desired
• Spatial Analyst is an incredibly powerful raster processing package
Copyright © 2006 by Maribeth H. Price
15-46
Raster Calculator
Use for executing map algebra expressions
Use to access Toolbox functions by directly typing tool command and arguments into the calculator.
Copyright © 2006 by Maribeth H. Price
15-47
ModelBuilderUse Spatial Analyst tools in ModelBuilder just as you can use any other tools.
This model generates watersheds and streams from a digital elevation model (DEM) using the Spatial Analyst hydrologic functions.
Copyright © 2006 by Maribeth H. Price
15-48
Analysis output types
• Permanent grids– Given name and location at time of creation– Can be used by other map documents
• Temporary grids– Created in working directory*– Rename in map document once created– May be converted to permanent grids later– Deleted from disk when removed from map!
*Set location where grids are created by default
Copyright © 2006 by Maribeth H. Price
15-49
Output coordinate systems
• Grids best stored in projected coordinate system for analysis
• Coordinate systems will be resampled or reprojected on the fly during analysis if needed– Convenient, but time-consuming
• Coordinate system handling– Output matches first raster input– Vectors will be reprojected to match rasters– User can override defaults by specifying that all raster
output will be in data frame coordinate system
Copyright © 2006 by Maribeth H. Price
15-50
The analysis environment
• General options– Working directory– Mask grid– Coordinate system options
• Analysis extent
• Analysis cell size
Copyright © 2006 by Maribeth H. Price
15-51
General options
• Working directory
• Analysis mask
• Analysis coordinate system
Copyright © 2006 by Maribeth H. Price
15-52
Analysis mask
Mask grid Elevation after masking
NoData
Data
Applies to ALL output grids
Masks may be grids, polygon shapefiles or feature classes. Coverages may not work properly.
Copyright © 2006 by Maribeth H. Price
15-53
Clipping a grid with masks
[Elevation]
mask
“Clip” grid by using Raster Calculator with a mask. Specify the output grid is the same as the input grid.
Copyright © 2006 by Maribeth H. Price
15-54
Clipping a grid with the toolbox
Copyright © 2006 by Maribeth H. Price
15-55
Analysis extent
Copyright © 2006 by Maribeth H. Price
15-56
Cell size and extent
Analysis extent Analysis cell size
Copyright © 2006 by Maribeth H. Price
15-57
Options/Environments
• The Spatial Analyst options set in the menu take precedence over the Environment Settings for functions executed from the menus.
• Tools, however, will honor the environment settings instead of the options settings
Copyright © 2006 by Maribeth H. Price
15-58
Did I mention not to use spaces in folder names?