fundamentals of gis lecture materials by austin troy except where noted © 2008 lecture 5:...
TRANSCRIPT
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Lecture 5:Introduction to Raster Spatial
Analysis
------Using GIS--
By Austin Troy and Weiqi Zhou, University of Vermont
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Raster data-A RefresherRaster Elements
–Extent
–# rows
–# columns
–Coordinates
–Origin
–Orientation
–Resolution
–Grid cell
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Raster Data Structuring• Methods for storing raster data in a more computationally
and memory efficient way.• Where a raster layer is random noise, this does not work.• Requires repetitive patterns or areas of homogeneity.• The fewer z values, the easier to compress.• Simplest method is cell-by-cell encoding where cell values
are stored by row and column number; This is essentially uncompressed.
• DEM’s and satellite images generally use this structure because there is typically so much variation.
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Raster Data Structuring• Run-length encoding (RLE):
– Compression method that records cell values in groups called “runs.”
– It records the starting and ending pixel for a “run” with the same value for a given row, so hundreds of pixels could be recorded with only two values, if they all have the same value and are adjacent.
– However, because it measures runs along rows, it is not efficient for two dimensional areas of homogeneity.
– RLE can reduce file size by 10:1, depending on data.
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Raster Data Structuring
• Runs:
– Row 2: 3,4
– Row 3: 2, 8
– Row 4: 4,7
– Row 5: 5,7
– Row 6: 2,6
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Raster Data Structuring• Chain code:
– This is a more efficient method for dealing with two-dimensional compression
– This defines a homogeneous two-dimensional area using cardinal directions and units movements to define bounding perimeter in relative terms from a known point
– For instance, go 2 N, 1 W, 1N, 3 W, 1S….etc.
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Raster Data Structuring• Here, starting from the
lower left, the computer would define that coordinate then code 1N, 3E, 1N, 1W, 1N, 2W, 1N, 1E, 1N, 2E etc…..
• This would define the perimeter of a homogeneous area.
• All must have exactly the same value
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Raster Data Structuring• Block code:
– A method that uses square blocks to represent areas of homogeneous values
– Each block is encoded only with location of one corner cell and the dimensions; since they are square, only one dimension needs to be given
– Uses medial axis transformation technique
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Raster Data Structuring• Quad tree:
– Divides a grid into hierarchy of quadrants– Starts with four quadrants; any quadrant that has totally homogeneous
cells will not be subdivided further, but is stored as a “lead node” which is coded only with that value and the id of the quadrant.
– Any quadrants with more than one value are subdivided again into four more quadrants and again the computer checks for homogeneity.
– It keeps on doing this until it has generated all its leaf node or until it gets down to the pixel level
– This is known as recursive decomposition– This is good where one part of a grid is very uniform and the rest is
heterogeneous.
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Raster Data Structuring• Quad tree:
Homogeneous
(all one value)
Not homogeneous: more than one value within quadrant
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Raster Data Structuring• Quad tree: now we break down those quadrants
with non-homogeneous values into four sub quadrants
Not homogeneous: more than one value within quadrant
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Raster Data Structuring• Quad tree: and we keep doing this until we’ve come
down to the point where there are only homogeneous quadrants, even if those are one cell in dimension
Not homogeneous: more than one value within quadrant
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Raster Data Structuring• Quad tree:
One value (leaf node)Mixed values (non-leaf)
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Converting vector to raster
------Using GIS--
Slide by Weiqi Zhou
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Converting vector to raster
------Using GIS--
Slide by Weiqi Zhou
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Raster Overlay Queries•The raster data model performs overlay operations more efficiently than the vector model Raster cells have a one-to-one relationship between layers
•Raster overlay queries involve the combining of two or more separate thematic layers to identify relationships between them such as:
–Areas that are common to all layers–Areas that meet criteria from each layer
Query example:
[elevation > 2500] AND [Slope>20]
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Overlay Calculations
•Map algebra can be performed to identify relationships between layers, or to derive indices that describe phenomena
•Map calculations create a new layer
Calculation example:(Soil_depth_1990) – (Soil_depth_2000)=loss in soil between 1990 and 2000
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
------Using GIS--
Source: ESRI
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Map Query ExamplesSingle layer numeric example: elevation > 2000 ft
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Map Query ExamplesResults in a binary True/False layer
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Map Query ExamplesMulti-criteria, single layer, categorical map query: looking for all developed land use types, using attribute codes (11, 12, 13) and OR
------Using GIS--
Vertical lines mean OR
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Map Query ExamplesResults in a 1/0 binary layer, showing urbanized areas
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Map Query ExamplesOne can then convert this to a vector shapefile or feature class
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Map Query: 2 layer ExamplesMulti-layer queries are use criteria across two or more layers; in this case we’ll query land use (categorical), elevation (number) and slope (number)
------Using GIS--
Let’s say we want to find identify potential habitat for a rare plant that grows at higher elevation, on steeper slopes and in coniferous forest
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Map Query ExamplesFirst we would generate a slope map from out Digital Elevation Model by going to Surface>>Derive Slope
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Map Query ExamplesLet’s say our criteria are elevation >800, slope >20% and land use category= coniferous forest (42)
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Map Query ExamplesAgain we end up with a 1/0 binomial query layer
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Map CalculationWe can also run calculations between layers: here we’ll multiply the k factor (soil erodability factor) by slope; let’s just imagine this will yield a more accurate and spatially explicit index of erodability that factors in slope at each pixel
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Map CalculationNow we simply type in the equation and a new grid is created that solves that equation
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Map CalculationThe darker areas are those with both steep slope and erodable soils. This has the advantage over map query in that we now have a continuous index of values, rather than just a “true” “false” dichotomy
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Map Calculation and QueryWe could then, for instance, run a map query to find areas that have high erodability factors and urban land use.
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Zonal StatisticsNow, say we had a proposed subdivision map (this one is made up). We could overlay it on our new index layer and figure out which proposed subdivisions are problematic
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Zonal StatisticsUsing Zonal Statistics we could summarize the mean, max or sum of the soil index for each of those units, even though one is grid and one is polygon. Here we summarize by mean the subdivision zones by the soil erodability calculation layer.
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Zonal StatisticsThis will create a DBF table that summarizes the pixel values by mean, median, max, min, etc., of all the pixels falling within a given polygon. Each row represent a polygon and each column represents a different summary statistic
------Using GIS--
Polygon layer with zones
Unique ID for polygons
This joins the DBF table to the polygon layer
Statistic by which your data will be charted
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Zonal StatisticsIt gives us a DBF table with values of mean, max, min, stdv, etc. in the table, plus a chart summarizing the means;
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Zonal StatisticsNow we can plot out the subdivision boundaries (zones) by a soil erosion statistic. In this case, clearly the most meaningful one is the mean of the soil erosion statistic. This represent the mean value, by polygon, of all the soil erosion pixels underlaying that polygon
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Reclassification with Grids
------Using GIS--
Here we reclass to 3 classes, based on natural breaks
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Reclassification with Grids
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Reclassification with Grids
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Reclassification with Grids
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Neighborhood Statistics
Fundamentals of GIS
©2007 Austin Troy
Low Pass filtering• Functionality: averaging filter
– Emphasize overall, general trends at the expense of local variability and detail.
– Smooth the data and remove statistical “noise” or extreme values.
• Summarizing a neighborhood by mean– The larger the neighborhood, the more you smooth, but the
more processing power it requires.– A circular neighborhood: rounding the edges of features.– Resolution of cells stays the same.– Using median instead of mean, but the concept is similar.
Fundamentals of GIS
©2007 Austin Troy
High Pass Filter• Functionality: edge enhancement filter
– Emphasize and highlight areas of tonal roughness, or locations where values change abruptly from cell to cell.
– Emphasize local detail at the expense of regional, generalized trends.
• Perform a high pass filter– Subtracting a low pass filtered layer from the original.
– Summarizing a neighborhood by standard deviation
– Using weighted kernel neighborhood
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Neighborhood Statistics• Min, max, mean,
standard deviation, range, sum, variety
• Window size/shape
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
• Low pass filtering: filtering out anomalies
Bathymetry mass points: sunken structures
Low pass filter with bathymetry
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
• After turning into raster grid
We see sudden anomaly in grid
Say we wanted to “average” that anomaly out
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
• Try a low-pass filter of 5 cells
We can still see those anomalies but they look more “natural” now
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
• Try a low-pass filter of 25 cells
The anomalies have been “smoothed out” but at a cost
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
• We can also do a local filter in that one area
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
What about high pass filters?• Say we wanted to isolate where the wreck was
All areas of sudden change, including our wrecks, have been isolated
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Low pass filter for elevation
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
A low pass filter of the DEM done by taking the mean values for a 3x3 cell neighborhood: notice it’s hardly different
DEM Low pass
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
10 unit square neighborhood
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
20 unit square neighborhood
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
In this high-pass filter the mean is subtracted from the original
It represents all the local variance that is left over after taking the means for a 3 meter square neighborhood
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
We do this using the map calculator
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
If we do a high-pass filter by subtracting from the original the means of a 20x 20 cell neighborhood, it looks different because more local variance was “thrown away” when taking a mean with a larger neighborhood
Dark areas represent things like cliffs and steep canyons
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Using standard deviation is a form of high-pass filter because it is looking at local variation, rather than regional trends. Here we use 3x3 square neighborhood
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
• Note how similar it looks to a slope map because it is showing standard deviation, or normalized variance, in spot heights, which is similar to a rate of change.
• Hence it is emphasizing local variability over regional trends.• The resolution of the slope is quite high because it is sampling
only every nine cells.• When we go to a larger neighborhood, by definition, the
resulting map is much less detailed because the standard deviation of a large neighborhood changes little from cell to cell, since so many of the same cells are shared in the neighborhood of cell x,y and cell x,y+1.
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
• Here is the same function with 8x8 cell neighborhood.
Here, the coarser resolution due to the larger neighborhood makes it so that slope rates seem to vary more gradually over space
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Later on we’ll look at filters and remote sensing imagery, but here is a brief example of a low-pass filter on an image that has been converted to a grid. This can help in classifying land use types
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Raster terrain functions in Arc GISArc GIS allows you to take a digital elevation model and derive:
•Hillshade
•Aspect
•Slope
•Contours
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Raster terrain functions in AVDEM + Hillshade = Hillshaded DEM
------Using GIS--
+ =
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Raster terrain functions in AVThis is done by making a hillshade using Spatial analyst, putting the hillshade “under” the DEM in the TOC and making the DEM transparent
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Raster terrain functions in Arc GISSlope: Contours: Aspect:
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Viewshed analysisThis is a multi-layer function that analyzes visibility based on terrain.It requires a grid terrain layer and a point layer and produces a visibility
grid layer that tells you where the feature can be seen from, or alternately, what areas someone standing at that feature could see (remember, line of sight is two way).
If there are more than one point feature, then each grid cell tells you how many of the point features can be seen from a given point.
However in that case, you lose information about the other direction; You don’t know which features can see a particular grid cell.
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.
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Viewshed analysisLet’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.
This generates a grid with three values, representing how many houses can see a given pixel
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Viewshed analysisThis 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
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Viewshed analysisIn 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.
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Viewshed analysisIn this case, red is for tower 1, blue for 2 and green for 3
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Proximity
------Using GIS--Introduction to GIS
Can use raster distance functions to create zones based on proximity to features; here, each zone is defined by the highway that is closest
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Distance Measurement
Can create distance grids from any feature theme (point, line, or polygon)
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Distance MeasurementCan also weight distance based on friction factors, like slope
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Combining distance and zonal stats
• Can also summarize distances by vector geography using zonal stats
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Combining distance and zonal stats
• Here we summarize by the mean
------Using GIS--
Fundamentals of GIS
Lecture Materials by Austin Troy except where noted © 2008
Density Functions•We can also use sample points to map out density raster surfaces. This need to require a z value in each, it can simply be based on the abundance and distribution of points.
•Pixel value gives the number of points within the designated neighborhood of each output raster cell, divided by the area of the neighborhood
Fundamentals of GIS
Density Functions
Lecture Materials by Austin Troy except where noted © 2008
Fundamentals of GIS
Density Functions
Lecture Materials by Austin Troy except where noted © 2008