Lecture 7 - Spatial Analysis
Lecture 7 - Spatial Analysis
Systems
Lecture 7
GIS Basic Functions -Part III
Spatial Analysis
Prepared by
Dr. Naglaa Fathy
[email protected]
Image source: Westfield State University
Agenda
• Spatial Analysis Definition
• Vector Data Analysis
✓Buffering
✓Overlaying
✓Other Feature Manipulation Methods
• Raster Data Analysis
✓Local Operations
✓Neighborhood Operations
✓Zonal Operations
2
Spatial Analysis
3
Vector Data
Analysis
Buffering
Overlaying
Other Feature Manipulation
Methods
4
Vector Data Analysis - Buffering
• Buffering is the process of creating an
area that is within a specified distance
of select feature. This area is the buffer
zone.
• The input layer could be point, line, or
polygon features.
• The output layer always contains
polygon feature(s) representing buffer
zone(s).
• Buffers are particularly suited for
determining the area of influence
around features of interest.
5
Vector Data Analysis - Buffering for Analysis vs. Buffering for Query
6
Vector Data Analysis - Variations in buffering
1. Variable width buffer
• A buffer based on different distances is called a variable buffer.
• For example, the noise level surrounding a street network may be
based on the traffic load. Therefore, a variable buffer may be used to
illustrate the noise level by using a larger distance for high traffic
roads and a shorter distance for quieter roads.
7
Vector Data Analysis - Variations in buffering
2. Multiple ring buffers
• Multiple ring buffers can be made such that a series of
concentric buffer zones (much like an archery target) are created
around the originating feature at user-specified distances.
• As an example, a nuclear power plant may be buffered with
distances of 5, 10, 15, and 20 miles, thus forming multiple rings
around the plant.
8
Vector Data Analysis - Variations in buffering
3. Doughnut buffers
• In the case of polygon layers, buffers can be created that
excludes the input polygon area.
• Polygons that are buffered from the boundary outwards.
4. Setback buffers
• On contrary, setback buffers are polygons that are only
buffered from the boundary inwards.
• An example of using setbacks is seen with property lines.
Setbacks can be used to buffer the distance from a
property line to show how far away from the property line
a building has to be.
9
Vector Data Analysis - Variations in buffering
5. Dissolved / Non-dissolved buffer
• Boundaries of overlapping buffer zones may be non-dissolved so that
each buffer zone is a separate polygon for further analysis.
• Or these boundaries may be dissolved to create an aggregate zone,
leaving no overlapped areas between individual buffer zones.
non-dissolved dissolved
10
Vector Data Analysis - Applications of buffering
A buffer zone is often treated as a protection zone for planning or
regulatory purposes.
• Government regulations may require that logging operations must be at least
2 miles away from any stream to minimize the sedimentation problem and set
the 2-mile buffer zones of streams as the exclusion zones.
• A national forest may restrict oil and gas well drilling within 500 feet of roads
or streams.
• For example, the siting criteria for an industrial park may require that a
potential site must be within 1 mile of a heavy-duty road. In this case, the 1-
mile buffer zones of all heavy-duty roads become the inclusion zones.
11
Vector Data Analysis - Applications of buffering
A buffer zone is often treated as a neutral zone and as a tool for conflict
resolution
• Recently, the best-known neutral zone is the demilitarized zone
separating North Korea from South Korea along the 38° N parallel.
13
Vector Data Analysis - Map Overlay Operations
• Overlay operations can take polygon, line, or point layers as the
inputs and create an output of a lower-dimension feature type.
For example, given the inputs of polygon and line layers, the output will be a
line layer.
• Three common overlay operations:
✓Point-in-Polygon,
✓Line-in-Polygon,
✓Polygon-on-Polygon.
• The layer that may be a point, line, or polygon layer is called the input
layer, and the layer that is a polygon layer is called the overlay layer.
14
Vector Data Analysis - Map Overlay Operations
1. Point-in-polygon
• The point-in-polygon overlay operation requires a
point input layer and a polygon overlay layer.
• Upon performing this operation, a new output
point layer is returned that includes all the points
that occur within the spatial extent of the
overlay.
• In addition, all the points in the output layer
contain their original attribute information as
well as the attribute information from the The dashed lines are for illustration only and
overlay. are not part of the point map
17
Vector Data Analysis - Map overlay Methods
18
Vector Data Analysis - Map overlay Methods
1. Union
• Union overlay method employs the OR operator.
• A union can be used only in the case of two polygon input layers.
• It preserves all features, attribute information, and spatial extents
from both input layers.
19
Vector Data Analysis - Map overlay Methods
2. Intersection
• Intersection overlay method employs the AND operator.
• An intersection requires a polygon overlay, but can accept a point,
line, or polygon input.
• It preserves only those features that fall within the area extent
common to the inputs.
20
Vector Data Analysis - Map overlay Methods
3. Symmetrical Difference
• Symmetrical difference overlay method employs the XOR operator,
which results in the opposite output as an intersection.
• This method requires both input layers to be polygons.
• The output polygon layer produced by the symmetrical difference
method represents those areas common to only one of the inputs.
21
Vector Data Analysis - Map overlay Methods
4. Identity ( or minus)
• Uses the following expression:
[(input layer) AND (identity layer)] OR
(input layer).
• This method creates an output layer
with the spatial extent of the input layer
but includes attribute information from
the other layer (referred to as the
“identity” layer, in this case).
• The input layer can be points, lines, or
polygons. The identity layer must be a
polygon dataset.
22
Vector Data Analysis - Map overlay Applications
23
Vector Data Analysis - Other Feature Manipulation Methods
24
Vector Data Analysis - Other Feature Manipulation Methods
1. Clip
• Creates a new layer that includes only those
features of the input layer, including their
attributes, that fall within the area extent of the
clip layer.
• The input may be a point, line, or polygon layer,
but the clip layer must be a polygon layer.
• For example, clip the extent of a river floodplain
by the extent of a county boundary.
• This is similar to the intersect overlay method;
however, the attribute information associated
with the clip layer is not carried into the output
layer following the overlay.
25
Vector Data Analysis - Other Feature Manipulation Methods
2. Erase
• It is the opposite of a clip.
• It removes from the input layer those features
that fall within the area extent of the erase layer.
• While the input layer can be a point, line, or
polygon dataset, the erase layer must be a
polygon.
• Continuing with our clip example, region
managers could then use the erase tool to erase
the areas of private ownership within the region
floodplain area.
26
Vector Data Analysis - Other Feature Manipulation Methods
3. Split
• Used to divide an input layer into two or
more layers based on a split layer.
• The split layer must be a polygon, while the
input layers can be point, line, or polygon.
• For example, a homeowner’s association
may choose to split up a countywide soil
series map by parcel boundaries, so each
homeowner has a specific soil map for their
own parcel.
27
Raster Data Analysis
Local
Neighborhood
Zonal
28
Raster data analysis
29
Raster Data analysis - 1. Local operations
30
Raster Data analysis - Local operations with single layer
31
Raster Data analysis - Local operations with single layer
Reclassification operation
• Reclassification is also referred
to as recoding, or transforming,
through lookup tables.
• Two reclassification methods
may be used:
➢The first method is a one-to-
one change, meaning that a
cell value in the input raster
is assigned a new value in
the output raster.
one-to-one Reclassification
32
Raster Data analysis - Local operations with single layer
Reclassification operation
• The second method assigns a
new value to a range of cell
values in the input raster.
• For example, cells with
population densities between 0
and 25 persons per square mile
in a population density raster
are assigned a value of 1 in the
output raster and so on.
33
Raster Data analysis - Local operations with single layer
34
Raster Data analysis - Local operations with Multiple layers
35
Raster Data analysis - Local operations with Multiple layers
1. Mathematical Functions
• The numbers within the aligned cells of the input grids can undergo
any user-specified mathematical transformation.
2. Summary Statistics
These include:
✓ Maximum, minimum, range, sum, mean, median, and standard
deviation, applied to rasters with numeric data in cells.
✓Majority, minority, and number of unique values applied to rasters
with numeric or categorical data in cells.
36
Raster Data analysis - Local operations with Multiple layers
2. Summary Statistics (examples)
37
Raster Data analysis - Local operations with Multiple layers
3. Combine Operation
• It assigns a unique output value to each
unique combination of input values.
• For example, Suppose a slope raster
has three cell values (0 to 20 percent,
20 to 40 percent, and greater than 40
percent slope), and an aspect raster has
four cell values (north, east, south, and
west aspects).
• The Combine operation creates an output
raster with a value for each unique
combination of slope and aspect, such as 1
for greater than 40 percent slope and the
south aspect, 2 for 20 to 40 percent slope
and the south aspect, and so on
38
Raster Data analysis - 2. Neighborhood Operations
• Also called a focal operation, involves a focal cell and a
set of its surrounding cells.
• Neighborhood operations employ a moving window
to calculate new cell values for every location
throughout the raster layer’s extent.
➢ This moving windows can take many different forms
depending on the type of output desired and the
phenomena being examined.
➢ Common forms of the moving window include
rectangles, circles, annuluses (doughnut-shaped),
and wedges.
➢ The moving window is commonly used to calculate
summary statistics (i.e., mean, standard deviation,
sum, minimum, maximum).
• Applied to a single raster only. 39
Raster Data analysis - Neighborhood operations
Example for calculating the average
• a rectangular, 3-by-3 moving window is
used to calculate the mean (average)
of values immediately surrounding a
given “focal” cell.
• The focal cell is that cell found in the
center of the 3-by-3 moving window.
• The moving window passes over every
cell in the raster. As it passes each
central target cell, the nine values in
the 3-by-3 window are used to
calculate a new value for that target
cell.
• This new value is placed in the identical
location in the output raster
40
Raster Data analysis - 3. Zonal operations
• Involves group of cells with the same value or similar features (zones)
• Single raster zonal operations:
✓Measure the geometry of each zone in the raster, such as area, perimeter,
thickness, and centroid.
• Two raster zonal operations:
✓Given two rasters in a zonal operation, one input raster and one zonal raster, a
zonal operation produces an output raster, which summarizes the cell values in
the input raster for each zone in the zonal raster.
✓The summary statistics and measures include minimum, maximum, sum,
range, mean,etc.
✓Zonal rasters are often created by reclassifying an input raster into just a few
categories
41
Raster Data analysis - Single Raster Zonal operations
• The cell size of the input raster is 1 The output
raster for the
Area Geometry
• The area = the sum of the cells Type
that fall within the zone x the cell
size.
• The perimeter of a contiguous
zone is the length of its
boundary, and the perimeter of a
noncontiguous zone is the sum of
the length of each part. The output raster
for the Perimeter
Geometry Type
42
Raster Data analysis - Two Raster Zonal operations
Zone layer:
• Defines the zones (shape, values, and Zone Layer
locations)
Input layer:
• contains the input values used in calculating
the output for each zone Input Layer
44
45