Copyright © 2006 by Maribeth H. Price 15-1 Chapter 15 Raster Analysis
Copyright © 2006 by Maribeth H. Price 15-2 Outline About rasters The grid raster format Raster analysis basics –Map algebra –Boolean overlay –Other raster functions Using Spatial Analyst
Copyright © 2006 by Maribeth H. Price 15-3 Outline Differences between the raster and vector data models and the benefits and drawbacks of each Basic facts about the storage and use of the grid data model Getting familiar with basic raster analysis functions Using Boolean map algebra to perform overlay analysis with rasters Controlling the analysis environment when using Spatial Analyst Using Spatial Analyst for raster analysis
Copyright © 2006 by Maribeth H. Price 15-4 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
Copyright © 2006 by Maribeth H. Price 15-5 Types of raster data Discrete raster: land use Continuous raster: DEM Continuous raster: image Discrete raster: roads
Copyright © 2006 by Maribeth H. Price 15-6 Raster Properties Scroll down for more info
Copyright © 2006 by Maribeth H. Price 15-7 Raster vs Vector models Raster strengths –Simple, robust format –Implicit georeferencing –Storage of continuous data –Surface analysis –Faster analysis Raster drawbacks –Storage space –Lower precision Vector strengths –Coordinate precision –Attribute management –Storage space –Flexible cartography Vector weaknesses –Surface analysis –Continuous data storage “Raster is faster, but vector is correcter.”
Copyright © 2006 by Maribeth H. Price 15-8 Raster resolution Measured by cell size Storage space increases dramatically with precision Vector format200 m raster50 m raster
Copyright © 2006 by Maribeth H. Price 15-9 Raster formats Grids –Special format for Spatial Analyst –Required to perform analysis –Integer or floating-point values Other formats –JPEG, TIFFs, MrSID, etc. –For display only
Copyright © 2006 by Maribeth H. Price Naming grids Names must be 13 characters or less Do not use spaces or non-alphanumeric characters to name grids No spaces in folders or grids –(underscore is OK) Remember. No spaces.
Copyright © 2006 by Maribeth H. Price Managing grids Working directories tend to get clogged with grids after a while and will need to be cleaned out Grids have complex data format Copy, move, and delete grids ONLY with ArcCatalog!!!!
Copyright © 2006 by Maribeth H. Price Grid attribute tables Created for discrete integer grids only Geology
Copyright © 2006 by Maribeth H. Price Converting features to raster Choose one attribute Grid value Text attribute carried over
Copyright © 2006 by Maribeth H. Price Converting raster to features Convert only discrete data without too many polygons To complex to convert OK to convert
Copyright © 2006 by Maribeth H. Price NoData Specific grid value to indicate lack of data Often replaced by zero in other formats Used to create masks NoData
Copyright © 2006 by Maribeth H. Price Georeferencing rasters Rows Columns x,y location Raster data file N rows by M columns x,y location Georeferenced to earth’s surface
Copyright © 2006 by Maribeth H. Price Georeferencing of images Some raster data comes already georeferenced, with an assigned coordinate system. –Landsat image –Digital elevation models –Digital map products from the USGS Other rasters have no georeferencing and must be prepared before use –Scanned maps or photos, pictures grabbed from Web
Copyright © 2006 by Maribeth H. Price The Georeferencing toolbar is used to link image locations to corresponding locations in an already georeferenced data set. After the links are established a final georeferenced map can be produced.
Copyright © 2006 by Maribeth H. Price Raster analysis Basic concepts Map Algebra Boolean overlay
Copyright © 2006 by Maribeth H. Price Map Algebra Rasters are essentially arrays of numbers Can be added, subtracted, etc Line up matching cells vertically Ingrid1 + Ingrid2 = Outgrid Fig Map algebra
Copyright © 2006 by Maribeth H. Price 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]
Copyright © 2006 by Maribeth H. Price Conversions [Precip_cm] / 2.54 Precip in cmPrecip in inches
Copyright © 2006 by Maribeth H. Price Cut and fill on a site [Initial surface] – [final surface] Cut Fill
Copyright © 2006 by Maribeth H. Price Model expressions Complex expressions with multiple inputs to calcuate 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]
Copyright © 2006 by Maribeth H. Price Logical expressions Produce a Boolean grid of 1’s and 0’s –1 = True –0 = False [EarthMove] > Elevation >
Copyright © 2006 by Maribeth H. Price Boolean expressions A AND B A XOR BA NOT B A OR B A B 0 1 Blue circles represent areas where condition holds (True) = 1
Copyright © 2006 by Maribeth H. Price Boolean Map Algebra True (1) False (0) A AND BA OR BA NOT BA XOR B Inputs ABAB Output Compare values of corresponding cells and determine output value
Copyright © 2006 by Maribeth H. Price Boolean overlay using map algebra AND = Find intersecting areas where all conditions are true to determine lodgepole habitat. Equivalent of vector Intersect
Copyright © 2006 by Maribeth H. Price Another way to look at Boolean intersection x = Boolean AND is equivalent to multiplication. So multiplying layers works just as well. 1 AND 1 = 1 1 AND 0 = 0 0 AND 1 = 0 0 AND 0 = 0 1 × 1 = 1 1 × 0 = 0 0 × 1 = 0 0 × 0 = 0
Copyright © 2006 by Maribeth H. Price Additive Boolean overlay = Instead of multiplying, add the layers together to create a ranked probability result.
Copyright © 2006 by Maribeth H. Price Other raster analysis techniques Reclassification Surface functions Distance functions Density functions Interpolation Neighborhood functions Zonal functions
Copyright © 2006 by Maribeth H. Price Reclassify Convert one set of grid values to another Manual or classify SlopeHigh slope/low slope
Copyright © 2006 by Maribeth H. Price Surface analysis DEM Slope Aspect Hillshade Contouring
Copyright © 2006 by Maribeth H. Price Viewshed analysis Areas visible from a set of observation points
Copyright © 2006 by Maribeth H. Price Distance functions Straight line distance Cost path distance Buffers
Copyright © 2006 by Maribeth H. Price 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 ElevationSlope Cost distanceCost direction
Copyright © 2006 by Maribeth H. Price Density Calculate from point distributions
Copyright © 2006 by Maribeth H. Price Interpolation Estimate gridded values between known points Three options –Inverse distance weighted –Kriging –Splining Rainfall grid from weather station data
Copyright © 2006 by Maribeth H. Price Neighborhood functions Output gridInput grid Window Target cell Averaging function
Copyright © 2006 by Maribeth H. Price Neighborhood majority High slope/low slope areas Before 5x5 majority filterAfter two passes of 5x5 majority filter Useful for simplifying rasters prior to conversion to polygons
Copyright © 2006 by Maribeth H. Price Cell statistics Calculate statistics for a stack of grids
Copyright © 2006 by Maribeth H. Price Zonal statistics Zones defined by a layer Value grid Calculates value statistics for each zone Watersheds Average slope
Copyright © 2006 by Maribeth H. Price Using Spatial Analyst Executing functions Temporary vs permanent output grids Resampling and coordinate systems Analysis environment options –Workspace –Extent –Cell size –Masks
Copyright © 2006 by Maribeth H. Price Menu tools Most commonly used functions are in the Spatial Analyst toolbar More functions can be found in ArcToolbox Some tools are slightly different than the menu tool—may have more or different options
Copyright © 2006 by Maribeth H. Price ArcToolbox Hundreds of additional functions found in ArcToolbox Use them in scripts and models if desired Spatial Analyst is an incredibly powerful raster processing package
Copyright © 2006 by Maribeth H. Price Raster Calculator Use for executing map algebra expressions Use to access Toolbox functions by directly typing tool command and arguments into the calculator.
Copyright © 2006 by Maribeth H. Price ModelBuilder Use Spatial Analyst tools in ModelBuilder just as you can use any other tools. This model generates watersheds and streams from a digital elevation model (DEM) using the Spatial Analyst hydrologic functions.
Copyright © 2006 by Maribeth H. Price Analysis output types Permanent grids –Given name and location at time of creation –Can be used by other map documents Temporary grids –Created in working directory* –Rename in map document once created –May be converted to permanent grids later –Deleted from disk when removed from map! *Set location where grids are created by default
Copyright © 2006 by Maribeth H. Price Output coordinate systems Grids best stored in projected coordinate system for analysis Coordinate systems will be resampled or reprojected on the fly during analysis if needed –Convenient, but time-consuming Coordinate system handling –Output matches first raster input –Vectors will be reprojected to match rasters –User can override defaults by specifying that all raster output will be in data frame coordinate system
Copyright © 2006 by Maribeth H. Price The analysis environment General options –Working directory –Mask grid –Coordinate system options Analysis extent Analysis cell size
Copyright © 2006 by Maribeth H. Price General options Working directory Analysis mask Analysis coordinate system
Copyright © 2006 by Maribeth H. Price Analysis mask Mask grid Elevation after masking NoData Data Applies to ALL output grids Masks may be grids, polygon shapefiles or feature classes. Coverages may not work properly.
Copyright © 2006 by Maribeth H. Price Clipping a grid with masks [Elevation] mask “Clip” grid by using Raster Calculator with a mask. Specify the output grid is the same as the input grid.
Copyright © 2006 by Maribeth H. Price Clipping a grid with the toolbox
Copyright © 2006 by Maribeth H. Price Analysis extent
Copyright © 2006 by Maribeth H. Price Cell size and extent Analysis extent Analysis cell size
Copyright © 2006 by Maribeth H. Price Options/Environments The Spatial Analyst options set in the menu take precedence over the Environment Settings for functions executed from the menus. Tools, however, will honor the environment settings instead of the options settings
Copyright © 2006 by Maribeth H. Price Did I mention not to use spaces in folder names?