#### Transcript Fundamentals of GIS - University of Vermont

------Using GIS-Fundamentals of GIS Lecture 5: Introduction to Raster Spatial Analysis By Austin Troy and Weiqi Zhou, University of Vermont Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS Raster data-A Refresher Raster Elements –Extent –# rows –# columns –Coordinates –Origin –Orientation –Resolution –Grid cell Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 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. Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 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. Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS Raster Data Structuring • Runs: – Row 2: 3,4 – Row 3: 2, 8 – Row 4: 4,7 – Row 5: 5,7 – Row 6: 2,6 Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 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. Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 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 Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 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 Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 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. Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS Raster Data Structuring • Quad tree: Homogeneous (all one value) Not homogeneous: more than one value within quadrant Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 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 Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 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 Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS Raster Data Structuring • Quad tree: One value (leaf node) Mixed values (non-leaf) Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Converting vector to raster Slide by Weiqi Zhou Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Converting vector to raster Slide by Weiqi Zhou Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Raster Overlay Queries •The raster data model performs overlay operations more efficiently than the vector model Raster cells have a oneto-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] Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS 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 Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Source: ESRI Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Map Query Examples Single layer numeric example: elevation > 2000 ft Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS Map Query Examples Results in a binary True/False layer Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Map Query Examples Multi-criteria, single layer, categorical map query: looking for all developed land use types, using attribute codes (11, 12, 13) and OR Vertical lines mean OR Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Map Query Examples Results in a 1/0 binary layer, showing urbanized areas Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Map Query Examples One can then convert this to a vector shapefile or feature class Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Map Query: 2 layer Examples Multi-layer queries are use criteria across two or more layers; in this case we’ll query land use (categorical), elevation (number) and slope (number) 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 Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Map Query Examples First we would generate a slope map from out Digital Elevation Model by going to Surface>>Derive Slope Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Map Query Examples Let’s say our criteria are elevation >800, slope >20% and land use category= coniferous forest (42) Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Map Query Examples Again we end up with a 1/0 binomial query layer Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Map Calculation We 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 Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Map Calculation Now we simply type in the equation and a new grid is created that solves that equation Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Map Calculation The 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 Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Map Calculation and Query We could then, for instance, run a map query to find areas that have high erodability factors and urban land use. Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Zonal Statistics Now, 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 Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Zonal Statistics Using 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. Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Zonal Statistics This 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 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 Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Zonal Statistics It gives us a DBF table with values of mean, max, min, stdv, etc. in the table, plus a chart summarizing the means; Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Zonal Statistics Now 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 Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Reclassification with Grids Here we reclass to 3 classes, based on natural breaks Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Reclassification with Grids Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Reclassification with Grids Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Reclassification with Grids Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS Neighborhood Statistics Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 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. ©2007 Austin Troy Fundamentals of GIS 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 ©2007 Austin Troy Fundamentals of GIS Neighborhood Statistics • Min, max, mean, standard deviation, range, sum, variety • Window size/shape Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS Low pass filter with bathymetry • Low pass filtering: filtering out anomalies Bathymetry mass points: sunken structures Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS • After turning into raster grid We see sudden anomaly in grid Say we wanted to “average” that anomaly out Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS • Try a low-pass filter of 5 cells We can still see those anomalies but they look more “natural” now Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS • Try a low-pass filter of 25 cells The anomalies have been “smoothed out” but at a cost Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS • We can also do a local filter in that one area Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 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 Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS Low pass filter for elevation Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 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 Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 10 unit square neighborhood Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 20 unit square neighborhood Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 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 Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS We do this using the map calculator Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 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 Dark areas represent taking a mean things like cliffs and with a larger steep canyons neighborhood Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 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 Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS • 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. Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS • 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 Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 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 Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS Raster terrain functions in Arc GIS Arc GIS allows you to take a digital elevation model and derive: •Hillshade •Aspect •Slope •Contours Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Raster terrain functions in AV DEM + Hillshade = Hillshaded DEM + = Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Raster terrain functions in AV This is done by making a hillshade using Spatial analyst, putting the hillshade “under” the DEM in the TOC and making the DEM transparent Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Raster terrain functions in Arc GIS Slope: Contours: Aspect: Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS Viewshed analysis This 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. Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 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. This generates a grid with three values, representing how many houses can see a given pixel Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 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 Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 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. Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS Viewshed analysis In this case, red is for tower 1, blue for 2 and green for 3 Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals Introduction toof GIS GIS Proximity Can use raster distance functions to create zones based on proximity to features; here, each zone is defined by the highway that is closest Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Distance Measurement Can create distance grids from any feature theme (point, line, or polygon) Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Distance Measurement Can also weight distance based on friction factors, like slope Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Combining distance and zonal stats • Can also summarize distances by vector geography using zonal stats Lecture Materials by Austin Troy except where noted © 2008 ------Using GIS-Fundamentals of GIS Combining distance and zonal stats • Here we summarize by the mean Lecture Materials by Austin Troy except where noted © 2008 Fundamentals of GIS 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 Lecture Materials by Austin Troy except where noted © 2008 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