working with raster

110
Return to Outline Getting started with surface analysis

Upload: john-stepl

Post on 26-Dec-2015

21 views

Category:

Documents


1 download

DESCRIPTION

r

TRANSCRIPT

Page 1: Working With Raster

Return to Outline

Getting started with surface

analysis

Page 2: Working With Raster

Return to Outline

Learning objectives • Explain what a raster surface is

• Describe surface representation

• Describe how specifying an analysis

environment affects output raster creation

• Control output raster creation by changing

environment settings

– Workspace

– Extent

– Cell size

– Coordinate system

Page 3: Working With Raster

Return to Outline

Surfaces • Considered to be continuous

• For an x,y location, only one z-value

• Can be used to represent

elevation, rainfall, snow depth,

land value, pH

• Surfaces cannot represent

3D objects like buildings

– Not a true 3D model: 2½-dimensional

. ..

.’. ‘.’

‘’ . ..

.’. ‘.’

‘’

. ..

.’. ‘.’

‘’

. ..

.’. ‘.’

‘’

. ..

.’. ‘.’

‘’

. ..

.’. ‘.’

‘’

X,Y

Z1

Z2

Z3

Page 4: Working With Raster

Return to Outline

Representing surfaces • Four ways

• Creating raster surfaces

– Interpolate from points (e.g., elevation, rainfall) Surfaces are created from continuous data

– Derived from another surface (e.g., slope,

aspect, hillshade)

Raster

s

Points

Contour

s TINs /

Terrains

Page 5: Working With Raster

Return to Outline

Sources of topographic data • U.S. federal government

– U.S. Geological Survey (USGS): digital elevation

model (DEM) Several resolutions

– USGS: National Elevation Dataset (NED)

– National Geospatial-Intelligence Agency (NGA):

digital terrain elevation data (DTED)

Spacing Z accuracy

7.5 minutes 30 meters 15 meters

15 minutes 2 arc-seconds

30 minutes 2 arc-seconds ½ of contour interval

1 degree 3 arc-seconds

Page 6: Working With Raster

Return to Outline

Interpolation • Generates surfaces from point measurements

Page 7: Working With Raster

Return to Outline

What is surface analysis? • Find patterns in the data

Elevation

Hillshade

Slope

Aspect

Page 8: Working With Raster

Return to Outline

How does surface analysis work? • Surface analysis is a process

– Input grid(s)

– Parameters

– Output grid

• A new grid can be the input for another process

Operations

Functions

Conditional statements

Analysis environment

Input Output/Input Output

Page 9: Working With Raster

Return to Outline

Before you begin surface analysis...

• Set the working directory

• Set the analysis mask

• Set the analysis

extent

• Set the analysis

cell size

Input 1 Input 2 Output

Maximum of Inputs

Intersection of Inputs Union of Inputs

NoData

D

Page 10: Working With Raster

Copyright © 2009 ESRI. All rights reserved. Creating and Analyzing Surfaces Using ArcGIS Spatial Analyst

Interpolating surfaces

Page 11: Working With Raster

Return to Outline

Learning objectives • Describe sample points

• Interpolate surfaces

• Assess accuracy

Page 12: Working With Raster

Return to Outline

What is interpolation? • Estimating an unknown value between known

samples

• Based on spatial autocorrelation and dependence

– The degree of relationship between near and far objects

– Things close together are more alike than things far apart Tobler’s first law of geography

Page 13: Working With Raster

Return to Outline

Visual comparison of

interpolators

Natural

neighbors

Spline

Kriging

IDW Topo to Raster

(Covered in lesson 3)

Page 14: Working With Raster

Return to Outline

Linear interpolation • Interpolation of cell values

– A best estimate between samples

Known rainfall values (inches)

Interpolated rainfall values

1.5 1.25 1.75 1.125 1.375 1.875 1.625 2 1

1 Mile

0 1

Page 15: Working With Raster

Return to Outline

The importance of samples • A perfect surface model needs infinite points

– Impossible: Can only record representative locations (samples)

– Other locations are estimated (interpolated) from the samples

• Good samples represent

– Important details

(enough to meet resolution needs)

– Surface extremes

(tops of hills, bottoms of valleys)

– Changes of surface

(breaks in slope)

• Good samples extend beyond the area of interest

(reduce edge effects)

Sampling area

Study

area

+ +

+

+ + + +

+

+

+

+ + +

+ +

+

+

+ +

+

Page 16: Working With Raster

Return to Outline

Controlling sample points • IDW, spline, and kriging control samples

• Two methods control the search radius

– Variable: Expands to find minimum number of

samples

– Fixed: Uses samples found in the specified

radius

Samples = 8

Radius = ?

Variable Fixed

Radius = 1000

Samples = ?

Page 17: Working With Raster

Return to Outline

Barriers to interpolation • Sharp breaks in the surface

– Like cliffs, ridges, fault lines

• IDW, spline, and kriging can use barriers

– Restricts samples to same side of line as cell

– Input as line features With barrier Without barrier

Page 18: Working With Raster

Return to Outline

Inverse distance weighted (IDW) • Averages values of samples near the cell

– Closer points have more influence

– Surface can pass through samples

– Cannot predict hills, valleys

• You set

– Power (how fast influence

drops with distance)

– Search radius

– Barriers

Page 19: Working With Raster

Return to Outline

IDW parameters • Best for dense, evenly spaced samples

• Surface falls between samples

– Averaging

– No hills or valleys

• Can adjust relative

influence of samples

– The Power option

Distance

Z-

va

lue

IDW

Distance

Power 1

Power 2

Sample point

Page 20: Working With Raster

Return to Outline

Natural neighbors • Advanced technique to select samples

– Builds area of influence of samples for each cell

– Uses area-weighted interpolation technique

• Creates a convex hull

around the samples

– Only interpolates

within the hull

• Good for very dense

samples, like lidar

Page 21: Working With Raster

Return to Outline

Spline • The surface passes exactly through the

sample points

– Like a rubber sheet that is bent around the

samples

– Good for smoothly varying surfaces, like

temperature

– Can predict ridges and valleys

Z-v

alu

e

Distance

Spline

Page 22: Working With Raster

Return to Outline

Choosing a spline type • Regularized

– Drapes the surface

– Higher hills, deeper valleys

– Smoother surface

– High {weight} smoothes more

• Tension

– Forces the surface

– Flatter hills and

valleys

– Coarser surface

–High {weight}

coarsens more

2000

3000

4000

Ele

va

tio

n

Distance

Tension

Regularized

Page 23: Working With Raster

Return to Outline

Topo to Raster • The best choice for interpolating terrain

– Creates a hydrologically correct

surface

– No sinks

– Drainage enforcement

• Uses contour lines and

points for samples

• Adjusts surface with

streams and lakes Points

Lakes

Streams

Contours

Boundary

D

Page 24: Working With Raster

Return to Outline

Choosing an interpolation method • If you know nothing about your data…

– Use natural neighbors — It is the most conservative; assumes all

highs and lows are sampled; will not create artifacts

• If your input data is contours…

– Use Topo to Raster — It is optimized for contour input; if not creating

a DEM, turn off the drainage enforcement option

• If you know the highs and lows are not sample…

– Use spline — Be careful of points that are near in space but very

different in value, creating unnatural artifacts

• If your surface is not continuous…

– Use spline with barriers if you know there are faults or other

discontinuities in the surface

Page 25: Working With Raster

Return to Outline

Testing a surface • To test the accuracy of a surface:

– Remove a sample

– Create the surface

– Check the sample against the surface

(Did the interpolator predict the missing sample?)

– Put the sample back; repeat with another sample

– Try a different interpolator and repeat

• Each interpolator gives different results

– None is more accurate than the others for all situations

– Choice is based on the surface type and the samples

Page 26: Working With Raster

Return to Outline

Terrains • Multiresolution surface created from

measurements stored in feature classes

– Large collections of mass point data (e.g., lidar)

– TIN surface generated on the fly for given area of

interest and level of detail

• Typical applications:

– Topographic mapping

– Bathymetric mapping

• Can convert to a raster

D

Page 27: Working With Raster

Return to Outline

Exercise goals • Create surfaces using a variety of

interpolation techniques

• Evaluate interpolation results

• Optionally, interpolate using IDW with

barriers

Page 28: Working With Raster

Copyright © 2009 ESRI. All rights reserved. Creating and Analyzing Surfaces Using ArcGIS Spatial Analyst

Introduction to kriging

Page 29: Working With Raster

Return to Outline

Kriging • A geostatistical method

– Assumes spatial variation in

data is the same everywhere

– Models variation with

many methods

– You need to know how to use it

• Can create hills and valleys

Ordinary

Universa

Page 30: Working With Raster

Return to Outline

Kriging semivariogram models • ArcGIS Spatial Analyst implements five

semivariogram models

– Spherical

– Circular

– Exponential

– Gaussian

– Linear

• ArcGIS Geostatistical Analyst has more

models and tools

– Interactive variogram modeling

Distance

Actual

variance

0

0

1,500

15,000

Semi-

variance

Predicted

variance

D

Page 31: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-31

Raster data

Page 32: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-32

The raster data model

Rows

Columns

X, Y

location

Raster data file

N rows by M columns

X, Y

location

Georeferenced to earth’s

surface

Page 33: Working With Raster

Return to Outline

Raster vs Vector

Page 34: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-34

Pixels or Cells

• Each pixel contains one numeric value

• Dimension of a pixel varies (resolution)

• Value represents some property of that pixel area, e.g. elevation or rainfall

• Values may be integers or floating point numbers

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

30m

30m

Unlike a polygon, each cell has only ONE attribute: its value.

Storing multiple values means storing multiple rasters.

Page 35: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-35

Binary data

• Most raster formats use binary storage

• Numbers are stored as a series of 0’s

and 1’s representing numbers in base 2

• Binary values are grouped by eight

10011101

1 bit

one byte

In base 2:

00000000 = 0

11111111 = 255

28 = 256

1111111111111111 = 65,565

216 = 65,566

two bytes

0

1

10

11

100

101

110

111

1000

1001

1010

1011

Page 36: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-36

Types of raster data

Discrete raster: land use Continuous raster: DEM

Continuous raster: image Discrete raster: roads

Page 37: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-37

Raster Properties

Scroll down

for more

info

Page 38: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-38

Bands

• A single raster may include multiple arrays

• Most often used to store color images and

satellite images 7-band Landsat satellite image

Page 39: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-39

Why use rasters?

• Better at storing certain kinds of data

• Better at analyzing certain kinds of data

• Often faster analysis than vectors

• Imagery desirable for certain maps

• BUT

– Coordinate precision generally lower

– High precision has high storage costs

– Cannot store multiple attributes

Page 40: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-40

Raster resolution

• Measured by cell size dimensions

• Storage space increases dramatically with

resolution

Vector format 200 m raster 50 m raster

Page 41: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-41

Cell size units

• Cell x-y resolution units are based on the

raster’s coordinate system definition

– Decimal degrees*

– Meters

– Feet

*Because distances and

areas are fundamental

bases for raster analysis, it

is almost always best to use

projected coordinate

systems for rasters.

Page 42: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-42

Raster analysis

• Raster analysis uses cell-by-cell functions on one or more input grids.

• Cells must be the same size and line up spatially.

• Older software required the user to ensure that all input rasters had exactly the same size, shape, and aligned cell sizes.

Page 43: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-43

Resampling

Y2

If input grids do not match, then one

must be resampled to match the

other. Resampling can degrade the

accuracy of a raster even if the

difference in cell size and location is

small.

The new cell grid is determined, and

the old cell values must be fit into the

new structure somehow.

Several methods are used for

resampling.

Page 44: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-44

Resampling methods Nearest neighbor resampling grabs the value from

the old cell that falls at the center of the new cell. It preserves

the original value and should always be used with categorical

data, or when the original data values need to be preserved. It

is the fastest method.

Bilinear resampling calculates a new value from the

four cells that fall closest to the center of the new cell. It uses

a distance-weighted algorithm based on the old cell centers. It

is best used with continuous data such as elevation.

Cubic convolution resampling calculates a new

value from the sixteen cells that fall closest to the center of the

new cell. It uses a distance-weighted algorithm based on the

old cell centers. It is best used with continuous data such as

elevation. It is the most time-consuming method.

Page 45: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-45

Raster analysis techniques

Map algebra and Boolean overlay

Other functions

Page 46: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-46

Map Algebra

( [Inlayer1 + [Inlayer2] ) / 2

Aligns overlying cells and

performs operations on

corresponding cells in input

layers.

Inlayer1

Inlayer2

Output

Page 47: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-47

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

Page 48: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-48

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]

Page 49: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-49

Conversions

[Precip_cm] / 2.54

Precip in cm Precip in inches

Page 50: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-50

Cut and fill on a site

[Initial surface] – [final surface]

Cut

Fill

Page 51: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-51

Model expressions

Complex expressions with

multiple inputs to calculate

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]

Page 52: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-52

Logical Operators

[Elevation] > 1200

Logical operators produce either TRUE (1) or FALSE (0)

values in the output grid, based on whether a cell meets

the condition.

[Slope] < 10 [crowncov] < 70 And

[crowncov] > 40

Page 53: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-53

Boolean rasters

• Boolean rasters represent maps of

True/False states for a particular condition

Slope < 10 degrees?

1 = True

0 = False

Page 54: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-54

Logical expressions

• Produce a Boolean

grid of 1’s and 0’s

– 1 = True

– 0 = False

[EarthMove] > 0

1

0

Elevation > 1400 1

0

Page 55: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-55

Boolean operators

A AND B

A XOR B A NOT B

A OR B

A B

Same as intersect! Same as union!

Boolean rasters

can be

evaluated

further using the

Boolean

operators.

Page 56: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-56

Raster analysis techniques

Map algebra and Boolean overlay

Other functions

Page 57: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-57

Other raster analysis techniques

• Reclassification

• Surface functions

• Distance functions

• Density functions

• Interpolation

• Neighborhood functions

• Zonal functions

Page 58: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-58

Reclassify

Convert one set of

grid values to

another

Manual or classify

Slope High slope/low slope

Page 59: Working With Raster

Return to Outline

Local Operations –

Reclassification(single raster)

• Range of values – a new value is given

to a range of values

• in the input raster (integer and floating

point rasters)

Page 60: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-60

Surface analysis

DEM

Slope

Aspect

Hillshade

Contouring

Page 61: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-61

Slope function

Calculates slope of the surface

based on surrounding cells. Can be

expressed in degrees or percent.

Page 62: Working With Raster

Return to Outline

Standard Slope Function

a b c

d e f

g h i

cingx_mesh_spa * 8

i) 2f (c - g) 2d (a

dx

dz

acing y_mesh_sp* 8

c) 2b (a -i) 2h (g

dy

dz

22

dy

dz

dx

dz

run

rise

run

riseatandeg

Page 63: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-63

Aspect function

Calculates direction of steepest

slope, e.g. which way the slope

“faces”. Value represents direction

from 0-360 where 0/360 is North.

Flat areas are assigned a -1 value.

Page 64: Working With Raster

Return to Outline

Aspect – the steepest downslope

direction

dx

dz

dy

dz

dy/dz

dx/dzatan

Page 65: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-65

Hillshade

Calculates the brightness or

illumination of a surface from a

specified light source.

Applications include terrain display

and modeling satellite reflectance.

Azimuth is direction

of illumination source

(315 by default)

Altitude is the angle

of the source above

the horizon (45 deg)

Page 66: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-66

Viewshed analysis

• Calculate areas

visible from a set of

observation points

Additional parameters

are available for the tool

version, such as the

horizontal angle included.

Page 67: Working With Raster

Return to Outline

Lecture Materials by

Austin Troy except

where noted © 2008

Viewshed analysis Viewshed analysis can use “offsets” to define the height of

the viewer or of the object being viewed; designated using a new field in the input layer’s attribute table.

offset A

offset B

Page 68: Working With Raster

Return to Outline

Lecture by Austin Troy ©

2005

Viewshed analysis This is done in ArcGIS 8, but can also be done in ArcView.

Red represents areas that can be seen by 1 house, blue by 2

or more

Page 69: Working With Raster

Return to Outline

Lecture by Austin Troy ©

2005

Viewshed analysis In order to compare the viewability of several facilities,

separate viewshed analyses need to be done for each

feature.

In the next example we will look at three candidate sites for a

communications tower.

Each will produce a viewability grid.

This grid can then be superimposed on a layer showing

residential areas.

Since each grid will belong to a different tower, we can tell

which tower will be most viewable from the residential

areas through simple overlay analysis.

Page 70: Working With Raster

Return to Outline

Lecture by Austin Troy ©

2005

Viewshed analysis In this case, red is for tower 1, blue for 2 and green for 3

Introduction to GIS

Page 71: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-71

Cut and fill on a site

[Initial surface] – [final surface]

Cut

Fill

Page 72: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-72

Hydrologic functions

Derive streams, watersheds, and other hydrologic features

based on analysis of a DEM.

Page 73: Working With Raster

Return to Outline

67 56 49 46 50

12 11 12

53 44 37 38 48

58 55 22 31 24

61 47 21 16 19

34 53

Digital Elevation Model

Page 74: Working With Raster

Return to Outline

32

16

8

64

4

128

1

2

Eight Direction Pour Point Model

Page 75: Working With Raster

Return to Outline

67 56 49

53 44 37

58 55 22

1

67 56 49

53 44 37

58 55 22

1

26.162

4467

14

1

5367

Slope:

Direction of Steepest Descent

Page 76: Working With Raster

Return to Outline

2 2 4 4 8

1 2 16

1 2 4 8 4

1 1 2 4 8

2 1 4 4 4

1 1

Flow Direction Grid

Page 77: Working With Raster

Return to Outline

Grid Network

Page 78: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-78

Distance functions

Straight line distance

Cost path distance

Buffers

Page 79: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-79

Straight line distance

• Starts from a set of features (points, lines, polygons).

• Creates a grid where each cell represents distance to the closest of the features.

• Distance units are given in coordinate system map units

Distance to roads (meters)

The distance

function is the first

step in in creating

raster buffers.

Page 80: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-80

Lowest cost path 1. 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

Page 81: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-81

What is interpolation?

• Interpolation is the prediction of values in

between measured points.

• Sampling of points may be uniform, random, or

based on a sampling scheme.

• Numerous methods are used which have

different mathematical models and make

different assumptions about the data.

• Best application of interpolation relies on

substantial study of models and assumptions. If

you use it a lot—learn more!

Page 82: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-82

Sample point features:

climate stations with

annual precipitation values

Interpolated continuous

raster of precipitation

values

Page 83: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-83

Interpolation is NOT truth!

Actual elevation Elevation interpolated from summits

Page 84: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-84

Methods

• Interpolation assumes that nearby points

are correlated, e.g. they will have similar

values.

• Four types of interpolation methods are

available in Spatial Analyst

– Inverse Distance Weighted (IDW)

– Spline

– Kriging

– Trend

Page 85: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-85

Density functions

• Appear similar to interpolation, but are calculated differently

– Interpolation predicts values between points using a variety of mathematical methods

– Density functions count occurrences within a given radius and divide by the area

Occurances may be features

or attributes of features

(number of cities versus city

population).

Page 86: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-86

Density methods

• Simple density

– Sums attribute (such as population) for points within a specified radius

– Larger radius gives smoother data

• Kernel density

– First spreads value at points out to the search radius using a quadratic formula.

– Then density is calculated again

– Tends to give smoother results for a given radius

Page 87: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-87

Using simple density

50km radius

100km radius

A larger radius gives smoother

results. The radius is given in

map units.

Units: people/sq km

Page 88: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-88

Line density

Density of

rivers m/sq km

100 km radius

50 km radius

Page 89: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-89

Neighborhood statistics Calculates a statistic for the specified window.

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

Window

Page 90: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-90

Window movement

No overlap. All cells in the block

receive the output value.

Overlap. Only the target cell

receives the value.

Page 91: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-91

Neighborhood focal functions

Output grid Input 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

Window Target cell

Averaging function

Page 92: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-92

Neighborhood focal mean

Smooths raster

Effects grow larger

with increasing

window size or

repeated

applications

Good for removing

noise or spurious

values

Page 93: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-93

Neighborhood focal majority

High slope/low slope areas

Before 5x5 majority filter After two passes of 5x5

majority filter

Useful for simplifying rasters prior to conversion to polygons

Page 94: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-94

What is a zonal function?

• Examines and manipulates raster values in one within set of zones specified by another layer

• Zones constitute the areas of a discrete raster with the same value

• Requires two inputs

– A layer specifying the zones (raster or feature)

– A raster layer with the values to be evaluated

Page 95: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-95

What is a zone?

• A zone is the area(s) of a raster or feature

dataset that share the same integer value.

Zones need not be contiguous!

Page 96: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-96

Zonal statistics

• Zones defined by

the zone layer

(watersheds)

• Generates statistics

for each zone from

the value grid

(slope)

• Output is either a

raster, or a table

Watersheds and slope

Average slope in watershed

Page 97: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-97

Zonal statistics of lines

Mean slope of

streams in each

watershed

Page 98: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-98

Zonal statistics of points

• Use name or FID for each point so each is unique zone.

• Calculate stats for each point.

• All statistics are the same—the elevation of the point.

Determine elevation of summits

Page 99: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-99

Raster analysis example

Siting a landfill

Page 100: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-100

Landfill raster model

• Problem: Find potential locations for a

new landfill using these criteria

– On flat terrain <= 10 degrees slope

– No more than 1 km from an existing road

– At least 500 meters from a stream

– Meadow or low-density forest

• Develop a Boolean raster for each

condition with 1 = desirable area, 0 = not

desirable area

Page 101: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-101

Slope condition 1. Use slope function on elevation raster.

2. Use map algebra logical operator to produce Boolean map of slope <= 10

degrees.

Page 102: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-102

Road distance condition 1. Use distance function to create raster of distance from roads.

2. Use logical operator in map algebra to create Boolean raster of areas within 1000

meters of a road.

[Distance] <= 1000

Page 103: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-103

Stream distance condition 1. Use distance function to create raster of distance from streams.

2. Use a logical operator in map algebra to create a Boolean map of areas more

than 500 meters from a stream.

[Distance] > 500

Page 104: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-104

Vegetation condition 1. Select suitable vegetation density and create a layer from the selected polygons.

2. Convert the selected vegetation layer to a raster using the density attribute.

3. Reclassify the three density values all to 1 and the NoData areas to 0.

Page 105: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-105

Find areas with Boolean AND [Slope] AND [Roads] AND [Streams] AND [Vegetation]

Page 106: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-106

Additive model [Slope] + [Roads] + [Streams] + [Vegetation]

Page 107: Working With Raster

Return to Outline

Lecture by Austin Troy ©

2005

Raster terrain functions in AV

DEM + Hillshade = Hillshaded DEM

+ =

Page 108: Working With Raster

Return to Outline

Lecture by Austin Troy ©

2005

Viewshed analysis Let’s say we’re local planners who are considering putting in

a new waste treatment facility in valley where the vacation

homes of five rich and powerful Hollywood executives are

located.

We want it in a place that won’t ruin anyone’s views, since

they comprise 95% of the local tax base.

So we geocode the house locations, overlay them on a high-

resolution digital elevation model and run a viewshed

analysis

The lower the resolution, the more likely we’ll be wrong

This generates a grid with three values, representing how

many houses can see a given pixel

Page 109: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-109

Page 110: Working With Raster

Return to Outline

Copyright © 2009 by Maribeth H. Price

8-110

x

x

x

x

A

B