Spatial Analysis
Overview DEM derivatives: slope and aspect Neighborhood Operations Boolean Operations with Raster Layers Algebraic Operations w/ Raster Layers Neighborhood Operations Problems with point location data
DEM derivatives: slope and aspect
GIS Terrain Surface & Topographic Analyses Operations on terrain data terrain data frequently produced using spatial interpolation and/or stereoscopic interpretation of aerial photography Terrain data models usually represented using a DEM (digital elevation model) also sometimes as a TIN (triangulated irregular network)
GIS Terrain Surface & Topographic Analyses Basic terrain surface properties, e.g.: Slope angle (gradient, steepness) Slope aspect (direction/orientation) Combine basic properties to achieve more complex analyses or create models
Derived Properties: Slope Angle Slope angle: Change in elevation per unit horizontal change i.e., how steep is the slope?, what is its gradient? units generally are degrees or percent The incline, or steepness, of a surface. Slope can be measured in degrees from horizontal (0-90), or percent slope (which is the rise divided by the run, multiplied by 100). A slope of 45 degrees equals 100 percent slope. Can be done in vector or raster; with raster, must compensate for minor errors due to grid cell quantization of space GIS calculates slopes and places them into classes Not limited to elevation could look at slope of change in population, precipitation, etc. TIN: software compares the distance between vertices of each of the TIN facets with horizontal coordinates Raster: Search eight neighboring cells
Calculating slope: Raster From Demers (2005) Introduction to Geographic Information
100 meter cell size 40 100 70 80 50 Gradient? Slope angle?
Steepness of Slope Slope is a measure of the steepness of a surface and may be expressed in either degrees or percent of slope. In this example, the red cells show steep areas and the green cells show flat areas.
Calculating slope: Applications Erosion analyses Landslide vulnerability Directing land development Updating soil surveys
Derived Properties: Slope Aspect Slope aspect: Orientation of the line of steepest slope i.e., what direction does the slope face units generally degrees from cardinal north Vector: Each of the facets of a TIN has a specific slope and aspect; can be grouped into classes Raster: Compare a central cell to its neighbors
Calculating aspect: Applications Relating aspect to others layers such as soils, vegetation Building wind generators Land use planning As an input to moisture index
Boolean Operations Boolean operations of OR & AND correspond to UNION & INTERSECTION, used in vector-based analyses A B A B OR A B UNION A B AND A B INTERSECTION We can apply these concepts in the raster spatial data model, when two input layers contain true/false or 1/0 data:
Boolean Operations with Raster Layers The AND operation requires that the value of cells in both input layers be equal to 1 for the output to have a value of 1: 1 1 AND = The OR operation requires that the value of a cells in either input layer be equal to 1 for the output to have a value of 1: 1 1 OR =
Algebraic Operations w/ Raster Layers We can extend this concept from Boolean logic to algebra Map algebra: Each cell is a number Mathematical operations are applied to the layers, calculated on a cell-by-cell basis The result for each cell is placed in a new layer. Example: suitability analysis Multiple input layers determine suitable sites: The pixels attributes in each layer represent ‘scores’. Layers are weighted based on their importance. Layer scores are added on a per-pixel basis.
Simple Arithmetic Operations 1 + = 2 Summation 1 = Multiplication 1 + = 3 2 Summation of more than two layers Near the mall Near work Near friend’s house Good place to live?
Raster (Image) Difference 5 1 7 6 3 4 2 - = -2 -1 -3 The difference between two layers: An application of taking the differences between layers is a form of change detection: Example: you have 2 images of the same forest, 10 years apart. To measure forest growth or cuts, you can take the difference in infrared light between image dates. More infrared light = more chlorophyll and more greenery Question: How can the locations where a substantial changes have occurred be identified using the difference layer?
Monitoring forest fire Pre-forest fire Post-forest fire Burned area identified from space
Raster (Image) Division Question: Can we perform the following operation? Are there any circumstances where we cannot perform this operation? Why or why not? =
More Complex Operations Linear Transformation 2 3 5 1 4 + = a b c This could applied in the context of computing a statistical linear regression (e.g. output y = a*x1 + b*x2 + c*x3) using raster layers Example: suitability analysis. Suitable place to live example. Near the mall – low importance (a=1) Near work – high importance (b=4) Near friend’s house – moderate importance (c=3)
The Revised Universal Soil Loss Equation (RUSLE) (Wischemeier and Smith 1978) A=RKLSCP A: the average soil loss R: the rainfall-runoff factor K: soil erodibility factor S: slope steepness L: the slope length factor C: crop management factor P: the support practice factor
Neighborhood Operations In neighborhood operations, we look at a neighborhood of cells around the cell of interest to arrive at a new value. We create a new raster layer with these new values. An input layer A 3x3 neighborhood Cell of Interest Neighborhoods of any size can be used 3x3 neighborhoods work for all but outer edge cells Neighborhood operations are called convolution operations.
Neighborhood Operations The neighborhood is often called: A window A filter A kernel They can be applied to: raw data (BV’s) classified data (nominal landcover classes) A 3x3 neighborhood
Neighborhood Operation: Mean Filter The mean for all pixels in the neighborhood is calculated. The result is placed in the center cell in the new raster layer. This operation can be done for all cells, or just some cells. 6 4 1 9 8 3 7 2 5 Input Layer 2 3 4 5 1 7 6 9 8 2 3 4 5 1 7 6 9 8 Result Layer 3 4
Landsat TM 543 False Color Image of Tarboro, NC Smoothed Image Landsat TM 543 False Color Image of Tarboro, NC Normal Image Smoothing Filter
Neighborhood Operations Suppose you have a nominal dataset: a landuse classification. Sometimes classifications are ‘speckled’. Usually a few misclassified pixels within a tract of correctly-classified landcover How do we correct this? Filter. We want to reclassify those pixels as the surrounding landcover type. What kind of filter do we use for this operation?
Neighborhood Operation: Majority Filter The majority value (the value that appears most often, also called a mode filter): 2 4 1 3 8 7 5 Input Layer Result
Neighborhood Operation - Variance We may want to know the variability in nearby landcover for each raster pixel: To find cultivated areas - usually less variability than natural areas To find where areas where eco-zones meet The variance of a 3x3 filter on, for instance, an NIR (near infra red) satellite image band will help find such areas. 6 4 1 9 8 3 7 2 5 Result Layer Input 2.75 5.75
The Mean Operation Revisited In the mean operation, each cell in the neighborhood is used in the same way: 1/9 6 4 1 9 8 3 7 2 5 Input Layer Result
Edge Enhancement Cells can be treated differently within a kernel: This is an edge enhancement filter (discussed below). -1 9 6 4 1 9 8 3 7 2 5 Input Layer Result -7 -26
Edge Enhancement Filter -1 9 Why is this an edge enhancement filter? It enhances edges. Ha! Let’s look at the kernel’s behavior at and away from edges: Away from edge (in areas with uniform landcover) At edges (between areas with differing landcover)
Edge Enhancement Filter -1 9 20 19 21 5 4 6 21 11 22 30 76 67 66 56 -21 -38 -48 8 9 -6 16 Filter Result:
Edge Enhancement Edge enhancement filters sharpen images. Normal Image Sharpening Filter Edge enhancement filters sharpen images.
Problems with point location data You have point location data, but you want data for your whole site/region. Examples: Air temperature maps created from point data. Water pollution levels measured at points. Solution: Estimate areas with no data.
Spatial Interpolation You have point data (temp or air pollution levels). You want the values across your full study site. Spatial interpolation estimates values in areas with no data. creates a contour map by drawing isolines between the data points, or creates a raster digital elevation model which has a value for every cell
Spatial Interpolation: Inverse Distance Weighting (IDW) One method of interpolation is inverse distance weighting: The unknown value at a point is estimated by taking a weighted average of known values Those known points closer to the unknown point have higher weights. Those known points farther from the unknown point have lower weights.
Sample weighting function Spatial Interpolation: Inverse Distance Weighting (IDW) point i known value zi distance di weight wi unknown value (to be interpolated) at location x The estimate of the unknown value is a weighted average Sample weighting function
Issues with IDW Weighted average estimates are always between the min and max known values. If the known (sampled) points did not include the minima and maxima (e.g., mountain peaks and valleys), your data will be less extreme than reality It is thus important to position sample points to include the extremes whenever possible
Issues with IDW The dashed line is a hill. The x’s are sampled elevation points. The black line is the interpolated (estimated) hill elevation. With IDW, the unknown points tend towards the overall mean.