lecture 20 - chapter 8 (raster analysis,...

15
GEOL 452/552 - GIS for Geoscientists I Lecture 20 - Chapter 8 (Raster Analysis, part1) 4 lectures on rasters - but won’t cover everything (Raster GIS course: Geol 588: GIS II (Spring 2011) Today: Raster data, Spatial Analyst setup, Boolean raster analysis, raster calculator, reclassification Ch 8 Tut 1 - 18 HW 12: Ch 8 ex. 1,2, 5, due Nov. 12 1

Upload: others

Post on 06-Sep-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 20 - Chapter 8 (Raster Analysis, part1)public.vrac.iastate.edu/~charding/Geol552_2009/... · GEOL 452/552 - GIS for Geoscientists I Lecture 20 - Chapter 8 (Raster Analysis,

GEOL 452/552 - GIS for Geoscientists I

Lecture 20 - Chapter 8 (Raster Analysis, part1)

• 4 lectures on rasters - but won’t cover everything

• (Raster GIS course: Geol 588: GIS II (Spring 2011)

• Today:

• Raster data, Spatial Analyst setup, Boolean raster analysis, raster calculator, reclassification

• Ch 8 Tut 1 - 18

• HW 12: Ch 8 ex. 1,2, 5, due Nov. 12

1

Page 2: Lecture 20 - Chapter 8 (Raster Analysis, part1)public.vrac.iastate.edu/~charding/Geol552_2009/... · GEOL 452/552 - GIS for Geoscientists I Lecture 20 - Chapter 8 (Raster Analysis,

• Elevation data (DEM)

• Visualize/analyze continuos data

• Topographic functions

• Boolean and Suitability analysis

• Distance (straight line and cost-of-travel) analysis

Some Raster GIS tasks

2

Page 3: Lecture 20 - Chapter 8 (Raster Analysis, part1)public.vrac.iastate.edu/~charding/Geol552_2009/... · GEOL 452/552 - GIS for Geoscientists I Lecture 20 - Chapter 8 (Raster Analysis,

• Identify the best (shortest)path between locations

• Statistical analysis within predetermined zones

• Interpolate data values for a study area based on samples

3

Page 4: Lecture 20 - Chapter 8 (Raster Analysis, part1)public.vrac.iastate.edu/~charding/Geol552_2009/... · GEOL 452/552 - GIS for Geoscientists I Lecture 20 - Chapter 8 (Raster Analysis,

• cells (pixels) in rows (vertical) and columns (horizontal)

• 2D matrix, 2D array

• resolution: cell width/height

• Extent (real world)

• “Local” coordinates (counting # of cells) vs. geo-location (UTM, lat/long)

Raster data

Local extent? Real-world extent?

4

Page 5: Lecture 20 - Chapter 8 (Raster Analysis, part1)public.vrac.iastate.edu/~charding/Geol552_2009/... · GEOL 452/552 - GIS for Geoscientists I Lecture 20 - Chapter 8 (Raster Analysis,

• Continuous Data:

• Surface (elevation, rainfall, pollution, ...)

• sampled at center of cell

• no discrete boundaries

• usually floating point value (can be integers)

• if floats: no attribute table

Smooth (Stretched) coloring (really: 256 colors)

Note: elevation values are “chopped off” here

(they are integers)...... but this really is

continuous data

5

Page 6: Lecture 20 - Chapter 8 (Raster Analysis, part1)public.vrac.iastate.edu/~charding/Geol552_2009/... · GEOL 452/552 - GIS for Geoscientists I Lecture 20 - Chapter 8 (Raster Analysis,

• discrete data (“classes”)

• value is mean as index only

• each cell filled with whole number

• stored as integer data

• Has “attribute table” (Usually: Value, Count)

• sometimes: also stores meaning (here Vegtype attribute)

• special case: binary grid (0,1 only)

Value VegType Count

1 Fir 6

... ... ...

6 Walnut 10

3 1 46 2 15 4 3

3 1 4413

4

3 1 4 4

124

1

1

30m

30m

6

Page 7: Lecture 20 - Chapter 8 (Raster Analysis, part1)public.vrac.iastate.edu/~charding/Geol552_2009/... · GEOL 452/552 - GIS for Geoscientists I Lecture 20 - Chapter 8 (Raster Analysis,

Spatial Analyst Setup• Spatial analyst (SA) = ArcGIS raster

module

• Copy follow along\Ch8A_class_ex and start ArcMap with Ch8A_class_ex.mxd

• We use Spatial Analyst as part of ArcMap(also: SA tools in ArcTools)

• 2 steps needed before you can work with Spatial Analyst in ArcMap

• 1) Activate module (GIS lab: needed every time) via Tools Extensions

• 2) Get Spatial analyst toolbar via View - Toolbars - Spatial Analyst

7

Page 8: Lecture 20 - Chapter 8 (Raster Analysis, part1)public.vrac.iastate.edu/~charding/Geol552_2009/... · GEOL 452/552 - GIS for Geoscientists I Lecture 20 - Chapter 8 (Raster Analysis,

Look at different types of raster data

• .img file = ERDAS IMAGINE format (special raster type “image”)

• vegetation: discrete data (index to vegetation type)

• Look at attribute layer:

• FORMATION = what type?COUNT = how many pixels per type?

• dem_float.img (elevation in feet)

• floating point, no attribute table

• symbolize as stretched (compare to Classified?)

• Stretched - Color ramp Elevation #1 (Right-click - Graphic View to switch between text and color ramp)

• precipitation.img: rainfall (in cm?)

• Note min/max of both floating point rasters

8

Page 9: Lecture 20 - Chapter 8 (Raster Analysis, part1)public.vrac.iastate.edu/~charding/Geol552_2009/... · GEOL 452/552 - GIS for Geoscientists I Lecture 20 - Chapter 8 (Raster Analysis,

Reclassify elevation and precipitation rasters into binary

• Binary raster: only possible values are 1 (True) or 0 (False) in each cell

• Encodes a condition: “is <something> True or False in this cell here?”

• Let’s make 2 new binary rasters: Spatial Analyst - Reclassify

• dem_float: if Value > 2300 set to 1 (otherwise: 0)

• Add Entry: 1600 - 2300 becomes 0 ; 2300 - 2600 becomes 1

• Output raster: high_elevation.img

• precipitation: Value < 30 set to 1 (otherwise: 0)

• Add Entry: 20 - 30 becomes 1 ; 30 - 35 becomes 1

• Output as low_precip.img

9

Page 10: Lecture 20 - Chapter 8 (Raster Analysis, part1)public.vrac.iastate.edu/~charding/Geol552_2009/... · GEOL 452/552 - GIS for Geoscientists I Lecture 20 - Chapter 8 (Raster Analysis,

Save as ERDAS .img file into your folder!

1

1

0

0

1

1

1

1

1

10

Page 11: Lecture 20 - Chapter 8 (Raster Analysis, part1)public.vrac.iastate.edu/~charding/Geol552_2009/... · GEOL 452/552 - GIS for Geoscientists I Lecture 20 - Chapter 8 (Raster Analysis,

Raster overlay (AND)• Which cells have high elevation AND low rainfall?

• Use raster calculator to:

• AND both rasters

• - or -

• multiply both rasters

1 × 1 = 11 × 0 = 00 × 1 = 00 × 0 = 0

1 AND 1 = 11 AND 0 = 00 AND 1 = 00 AND 0 = 0

both conditions

are True here

11

Page 12: Lecture 20 - Chapter 8 (Raster Analysis, part1)public.vrac.iastate.edu/~charding/Geol552_2009/... · GEOL 452/552 - GIS for Geoscientists I Lecture 20 - Chapter 8 (Raster Analysis,

Raster calculator• Important:

• In the GIS lab do not use the C: or D: drive as Working directory for temp rasters (as they will be deleted there at logout!)

• Instead set your Working directory (folder) to your student folder (Spatial Analyst - Options)

• [high_elev.img] AND [low_precip.img]

• [high_elev.img] * [low_precip.img]

• Makes a new raster called Calculation (a temporary raster)

• Always make temp rasters (“Calculation”) permanent!

• R-click on raster, Data - Make Permanent, save in your folder as “both_conditions.img”

• Rename layer to both_cond in Table of content

12

Page 13: Lecture 20 - Chapter 8 (Raster Analysis, part1)public.vrac.iastate.edu/~charding/Geol552_2009/... · GEOL 452/552 - GIS for Geoscientists I Lecture 20 - Chapter 8 (Raster Analysis,

13

Page 14: Lecture 20 - Chapter 8 (Raster Analysis, part1)public.vrac.iastate.edu/~charding/Geol552_2009/... · GEOL 452/552 - GIS for Geoscientists I Lecture 20 - Chapter 8 (Raster Analysis,

• Result: cells with 1 have high elevation (>2300 ft.) AND low rainfall (< 30 cm)

• What % of the total area is that?

• What area for each cell?

• Look at Properties - Source

• How many cells with VALUE=1?

• Look at COUNT in Attribute table

• here: 3908 cells of a total of 33174 (194 columns by 171 rows) = ~ 11%

result of AND

14

Page 15: Lecture 20 - Chapter 8 (Raster Analysis, part1)public.vrac.iastate.edu/~charding/Geol552_2009/... · GEOL 452/552 - GIS for Geoscientists I Lecture 20 - Chapter 8 (Raster Analysis,

Wrap up

• Lab: Ch 8 Tut 1 - 18

• Tutorial will prep for HW

• HW 12: Ch 8 ex. 1,2, 5, due Nov. 12

• (based on same data as used in ex_8a.mxd)

• Straight line distance function in: Spatial Analyst - Distance ...

• Remember to set your Working directory (SA - Options) to your folder!

15