Presentation is loading. Please wait.

Presentation is loading. Please wait.

by Ayse Kilic with materials from David G

Similar presentations


Presentation on theme: "by Ayse Kilic with materials from David G"— Presentation transcript:

1 Spatial Analysis Using Grids CIVE 835- GIS in Water Resources Fall 2016
by Ayse Kilic with materials from David G. Tarboton, Utah State University and from ESRI software

2 Spatial Analysis Using Grids
Learning Objectives Continuous surfaces or spatial fields representation of geographical information Grid data structure for representing numerical and categorical data How to perform Map algebra raster calculations Interpolation methods for rasters Tools that we are going to cover Map algebra; Interpolation; slope

3 Readings: http://desktop.arcgis.com/en/arcmap

4 Documentation for ArcMap can be found under “Manage Data” data Information about “Raster and images” can be located under “Data Types” on the left

5 Raster and Images, starting from "Introduction/What is raster data" to end of " Tutorials and workflows"

6 Archived, but it is sill available at http://resources. arcgis
Raster and Images, starting from "Introduction/What is raster data" to end of " Fundamentals of raster data/Rasters with functions" Reading assignment

7 Readings – at http://resources.arcgis.com/
Archived, but it is sill available Readings – at What is the ArcGIS Spatial Analyst extension and Essential ArcGIS Spatial Analyst extension vocabulary

8 Definitions

9 1. Discrete (vector) and 2. Continuous (raster) data
Discrete is also called thematic, categorical, or discontinuous data Continuous Continuous Discrete is also called thematic, categorical, or discontinuous data. These are all objects. House, stream, lake are separate units in discrete view (each is an object) Raster are not objects. Each location has a value Continuous- defined everywhere and usually an equal gridded spacing. Just tells us the value for a pixels. Discrete Discrete data are groups of individual objects. Each object can be different (roads, streams, houses) Continuous data are grids of pixels where each pixel has a value. Therefore the information is continuous in space. Anywhere you go, there is a value (a pixel value). Images from

10 To summarize: Two fundamental ways of representing spatial geography are discrete (separated) objects and rasters (fields). The discrete object view represents the real world as individual objects with well defined boundaries in empty space. (x1,y1) Points Lines Polygons The field view represents the real world as a finite number of variables, and each variable is defined at each possible position. Discrete: distinct, detached, disconnected, discontinuous Raster representation - Every point has a value. Both systems are useful and serves an important purpose x y f(x,y) Continuous surface

11 Different Ways for Numerical representation of a spatial surface (field)
Real World 1. Grid or Raster 2. TIN (Triangulated Irregular Network) 3. Contour and flowline (Mesh) Elevation and contours are overlaid on the upper right figure. Fields can represent any number of two or three dimensional surfaces (any kind of gridded data)

12 Common Uses of Raster Data
Rasters as basemaps (i.e. aerial Photo, satellite imagery, scanned maps) Rasters as surface maps of characteristics (i.e. elevation) Rasters as thematic maps (i.e. landuse)

13 A grid defines geographic space as a mesh of identically-sized square cells. Each cell holds a numeric value that measures a geographic attribute (like elevation) for that unit of space. 549 542 538 534 528 522 518 512 548 541 536 530 524 515 511 558 551 532 525 519 571 559 544 537 514 585 583 576 563 505 606 593 578 546 513 497 612 600 584 568 550 533 516 611 586 498 601 592 580 565 545 508 594 577 570 560 547 521 614 605 597 588 575 527 622 603 595 620 610 582 554 627 616 604 574 564 631 618 572 566 557 628 591 552 602 561 617 590 573 562 613 567 579 553 569 Elevation (meter) for part of Upper Klamath Basin, OR

14 Raster vs. Vector Data Vector Raster Point Line Polygon
Raster data are described by a cell grid, one value per cell Vector Raster single cell Point Line line of cells DRM Polygon zone of cells

15 Line as a Sequence of Cells
How do we define a line (stream) using grid cells? in GIS, we can create a line in a raster system by identifying a continuous sequence of adjacent cells.

16 Stream Networks Using Cells
The same number identifies cells that are in the same reach We give groups of cells the same value to show that they are part of the same sub-system. Red cells are ‘nodes’ where two segments join together.

17 Polygons as Zones of Grid Cells
How do you make polygons from raster? Groups of raster that have the same value When we use grid cells, we have to break down polygon shapes like lakes or soil types into individual grid cells We start on the left with a accurate picture of well-defined boundaries and we end up with a pixelated view on the right

18 To summarize: Raster and Vector are two methods of representing geographic data in GIS Both represent different ways to encode and generalize geographic phenomena Both can be used to encode both fields and discrete objects In practice there is a strong association between raster and fields and vector and discrete objects DRM

19 Characteristics of Grids
A grid is defined by extent, spacing, and perhaps a no data value Extent is the Number of rows, Number of columns Top-left and bottom-right coordinates Spacing is the Cell size (X and Y) NODATA is outside the extent or is undefined Number of Columns Number of rows Extent: How big do you want it to be? Where does it start? Spacing: How big you want the cells to be (X,Y) NODATA cell Cell size Extent: How big do you want it to be? Where does it start? Spacing: How big do you want the cells to be

20 NODATA Cells

21 Types of Grid Values There are two types of grids: Integer and Floating point Use integer grids to represent discrete data (land use classes) Use floating-point grids to represent continuous data (elevation) Grids may have associated attribute table (especially for integers) Attribute tables describe overall characteristics for the entire grid

22 Grids Using Floating Point (Decimal Numbers)
ET from center pivots Continuous data surfaces using floating point or decimal numbers Examples are ET (evapotranspiration), elevation, precipitation

23 Grids Using Integers (Categorical) Integer valued grids to represent zones
Examples are Landuse classes, soil types, political units

24 A Value Attribute Table (VAT) is used to summarize categorical (integer) grid data
Attributes of grid zones

25 How are values for (Floating Point) Rasters determined?
There are three ways that a “Value” for a grid cell is determined from Michael F. Goodchild. (1997) Rasters, NCGIA Core Curriculum in GIScience, posted October 23, 1997

26 Cell size of raster data
The level of detail (of features/phenomena) represented by a raster is dependent on the cell size. (Cell size matters!!!) Estimates of area Discrete data If you use 1 meter cell, the area for polygon (count the number) is 73 of them If you use 4 meter cell, the area for polygon (there are 5 cells; each cell is 16 m2) is 80 m2. The cell must be small enough to capture the required detail but large enough so computer storage and analysis can be performed efficiently.

27 Integer Rasters (Categorical) How do we determine the value for each cell?
Conversion from vector to raster Central point rule (which category is at the center of the cell?) Largest share rule (which category dominates?) Central point rule- Look at the center of pixel and take that value Winner takes it all! Whatever is happening at the center

28 Map Algebra/Raster Calculation
Water Balance Example Precipitation - Losses (Evaporation + Infiltration) = Runoff 5 2 3 4 7 6 - = We can do cell by cell evaluation of mathematical functions 5-3= 2

29 For example: Runoff generation processes
Infiltration excess overland flow (known as Horton overland flow) P P f P qo f Partial area infiltration excess overland flow P P P qo f Delete or skip this slide. P Saturation excess overland flow P P qo qr qs

30 Runoff generation at a point depends on
Rainfall intensity or amount Antecedent moisture conditions Soils and vegetation type Depth to water table (topography) Time scale of interest These factors vary spatially. They can all be represented by raster layers. That suggests using a spatial approach (GIS) to estimate runoff. Use the power of computers!

31 Cell based generation of runoff and routing of discharge
Radar Precipitation grid Soil and land use grids Calculate a Runoff grid from raster-based calculations using runoff generation formulas We use a DEM to show accumulation and routing of runoff within watersheds

32 Raster calculation – some complications
Sometimes different layers have different: Cell size Extent Projection We need to tell Arc how to combine these data layers. We may need to reproject, and resample to a common cell size. +

33 Raster calculation – some complications
An Analysis Mask is used to tell Arc how to resample or interpolate (and reproject) inputs to the target extent, cell size, and projection + = Analysis mask (Domain) Analysis cell size Analysis extent

34 Spatial Snowmelt Raster Calculation Example
40 50 55 43 47 41 44 42 100 m 150 m 4 6 2 4 Taking snow depth today Subtract what melted Find snow depth at next day

35 Lets describe the Rasters in ArcGIS
snow.asc ncols nrows xllcorner 0 yllcorner 0 cellsize NODATA_value temp.asc ncols nrows xllcorner 0 yllcorner 0 cellsize NODATA_value 4 6 2 4

36 Creating Raster Files from the Ascii
1. First copy and save each of the columns in the previous slide into a WordPad file. For example, copy: ncols nrows xllcorner 0 yllcorner 0 cellsize NODATA_value 4 6 2 4 to a text file and name it temp.asc Do the same thing for snow.asc ncols nrows cellsize 4 2 6 150 m

37 Creating Raster Files from the ASCII
1. First copy and save each of the columns in the previous slide into a WordPad file. For example, copy: ncols nrows xllcorner 0 yllcorner 0 cellsize NODATA_value 4 6 2 4 to a text file and name it temp.asc The above is the ‘format’ that Arc ‘understands.’ Do the same thing for snow.asc 2. Go to the ASCII to Raster Converter tool in the Arc Toolbox:

38 Creating Raster Files from ASCII files
3. In the ASCII to Raster tool, ‘point’ to where the snow.asc (or temp.asc) file is stored 4. Point to where the output will be stored and give it a name like “snow_100m” 5. Set the output data type to “FLOAT” so that it can have a decimal value.

39 Screenshot of ArcGIS with two layers (snow and temperature)
The two layers that have been loaded into ArcGIS

40 Now we can perform the New depth calculation using Raster Calculator
“snow100” * “temp150” Enter Formula Dnew= Dold – 0.5 T The two layers that have been loaded into ArcGIS Environments settings (see next slide)

41 Use Environment Settings to select Cell Size of the Product (look under “Raster Analysis”)
Tell Arc how to resample or interpolate (and reproject) inputs to the target extent, cell size In this case, we could select the 100 m cell size of the snow depth (minimum)

42 Use Environment Settings to select Cell Size of the Product
Tell Arc how to resample or interpolate (and reproject) inputs to the target extent, cell size But, instead, let’s produce a 150 m output by selecting Maximum of Inputs Now we can press run (OK) on the raster calculator.

43 Snow Depth on Day 2 at 100 m using Minimum cell size (minimum of inputs)
38 52 47 41 42 39 45 But, note that these results are ‘wrong’ because Arc has ‘resampled’ temperature from 150 m to 100 m using nearest neighbor (NN) resampling. Instead, we want to use bilinear resampling. Therefore, we will (later) first resample T to 100 m using bilinear and THEN we will make the calculation. Note: When Arc does NN resampling, and there is a “tie” between two cells (because they are both the same distance away from the cell being calculated), Arc choses the cell to the right, or the cell below, or both

44 The Result for Snow Depth on Day 2 (colorized) using Maximum cell size
Outputs are on 150 m grid. How were values obtained ? 38 52 41 39

45 Example and Pixel Inspector

46 When input layers have different cell sizes
When we have two different input cell sizes, we have to specify one of them for the output cell size. If you specify using the layer having the maximum cell size, then the input layers having the smaller cell size will be resampled. The default resampling in Arc uses Nearest Neighbor 40 50 55 43 47 41 44 42 100 m Inside Arc: The NN resampling grabs the input cell that is closest to the center of the output cell 38 52 4 2 6 150 m Nearest Neighbor Resampling with Cellsize Maximum of Inputs There are 9 of 100 m cells Only 4 of them will be selected for the calculations (because we use NN) 150 m 41 39 Output raster There are 9 of the 100 m cells Only 4 of them will be selected for the calculations (because we use NN) See next slide

47 Nearest Neighbor (NN) Resampling of the Snow Depth of Day 1 using Cell size based on “Maximum of Inputs” The NN resampling grabs the input cell that is closest to the center of the output cell Red symbols are centers of the 150 m cells 40 50 55 43 47 41 44 42 100 m Resampled Snow Depth to 150 m 40 55 Nearest Neighbor Resampling with Cellsize Maximum of Inputs 42 41 Resampling the 100 meter input to 150 meters using NN There are Nine 100 m cells . Only 4 of them will be selected for the calculations (because we use NN). Note that some spatial information is lost during resampling.

48 Snow melt calculation using the Nearest Neighbor (NN) Resampled snow depth based on “Maximum of Inputs” Resampled Snow Depth to 150 m Now we can make calculations with all the inputs and outputs at 150 meter 40 55 40-0.5*4 = 38 Dold 55-0.5*6 = 52 38 52 42 41 42-0.5*2 = 41 Dnew 4 2 6 150 m Nearest Neighbor Resampling with Cellsize Maximum of Inputs 41-0.5*4 = 39 41 39 However, only 4 of original snow depths were utilized because we use NN. T

49 Nearest Neighbor (NN) Resampling using Cell size based on “Maximum of Inputs”
We could have combined the resampling and calculations into one step as shown here (this is what Arc Does) 40 50 55 43 47 41 44 42 100 m Red symbols are centers of the 150 m cells 40-0.5*4 = 38 Dold 55-0.5*6 = 52 38 52 42-0.5*2 = 41 Dnew 4 2 6 150 m Nearest Neighbor Resampling with Cellsize Maximum of Inputs 41-0.5*4 = 39 41 39 There are Nine 100 m cells Only 4 of them will be selected for the calculations (because we use NN) T

50 The Selection of the Cell size and sampling frequency need to agree with the behavior of our data
We need to sample more frequently to capture high frequency changes We need to sample a longer series to capture the full data extent If we are interested in behavior of the process (i.e. solar radiation), we need to sample frequently enough 2) You don’t even know that there is a valley because you did not sample a larger extent/area 3) Too large of a cell size to sample, you miss the resolution. For example, sampling temperature of center pivot field using MODIS From: Blöschl, G., (1996), Scale and Scaling in Hydrology, Habilitationsschrift, Weiner Mitteilungen Wasser Abwasser Gewasser, Wien, 346 p. We need to use a smaller cell size to capture the full range of values For example, sampling temperature of center pivot field using MODIS

51 Interpolation and Resampling
We can resample to Estimate values between known values A set of spatial analyst functions that predict values for a surface from a limited number of sample points creating a continuous raster. Apparent improvement in resolution may not be justified

52 Interpolation methods
Nearest neighbor Inverse distance weight Bilinear interpolation Kriging (best linear unbiased estimator) Spline Cubic convolution Known data points are large red circles Bilinear : points on the left, right, below, above. 5 points Cubic convolution: Uses 8 points Nearest Neighbor (gets the values from the closest old cell). We want to create a grid of the small red circles Bilinear : use points on the left, right, below, above. (4 points) Cubic convolution: Uses 8 points Nearest Neighbor (gets the values from the closest old cell). (For resampling only)

53 Resampling in Arc

54 Resampling Methods in Arc

55 Resample 150 m Temperature data to 100 m to get consistent cell size and better resolution
Spacing & Support Lets redo the calculations at 100 m resolution by resampling temperature from 150 m to 100 m using bilinear 4 6 2 5 3 Black values are original The white values are resampled with BiLinear Bi-linear uses linear interpolation in two (bi) directions The new 100 m values make sense!! Air Temperature, C

56 Cell by cell snowmelt calculations using 100 m cell size
We are now using ALL of the original snow depth data. Nothing is being thrown away 40 50 55 43 47 41 44 42 100 m 40-0.5*4 = 38 50-0.5*5 = 47.5 55-0.5*6 = 52 42-0.5*3 = 40.5 38 47.5 52 47-0.5*4 = 45 43-0.5*5 = 40.5 40.5 45 40.5 42-0.5*2 = 41 4 5 6 44-0.5*3 = 42.5 150 m 39 41 42.5 4 6 41-0.5*4 = 39 3 4 5 2 4 Two inputs on the left have the same 100 m resolution 2 3 4 Resampled Temperature to 100 m

57 Re-Calculated Snow Depth with consistent 100 m cell size
“snow100” * “temp100” 38 52 41 39 47.5 40.5 42.5 45

58 Re-Calculation with consistent 100 m cell size grid
“snow100” * “temp100” Note, if we compare these results with the original result using automatic nearest neighbor resampling and minimum cell size, we see a slight difference. 38 52 41 39 47.5 40.5 42.5 45 38 52 47 41 42 39 45 (w/ NN) (w/ bilinear)

59 Conclusion Don’t let Arc ‘decide’ on which interpolation/resampling to use. ALWAYS resample the layers yourself using the best resampling approach (NN, bilinear, etc.) THEN make the calculations

60 Illustration of different Interpolation techniques
When you have to create a grid from a limited set of data points

61 Interpolation methods
Nearest neighbor Inverse distance weight Bilinear interpolation Kriging (best linear unbiased estimator) Spline Cubic convolution Known data points are large red circles Bilinear : points on the left, right, below, above. 5 points Cubic convolution: Uses 8 points Nearest Neigbor (gets the values from the closets old cell). We want to create a grid of the small red circles (For resampling only)

62 Nearest Neighbor “Thiessen” Polygon Interpolation
Point to Raster Interpolation Spline Interpolation Nearest Neighbor “Thiessen” Polygon Interpolation Light blue area all gets the same value measured at the black dot in the center

63 Interpolation Comparison
Thin plate spline Thiessen Inverse Distance Squared Kriging (zero nugget, large range) IDW and Thiessen refuses to go above local maximum and below local minimum. Sixth order polynomial Kriging (different nugget and range parameters) Grayson, R. and G. Blöschl, ed. (2000)

64 Further Reading Grayson, R. and G. Blöschl, ed. (2000), Spatial Patterns in Catchment Hydrology: Observations and Modelling, Cambridge University Press, Cambridge, 432 p. Chapter 2. Spatial Observations and Interpolation Full text online at:

65 Summary Concepts Grid (raster) data structures represent surfaces as an array of grid cells Raster calculation involves algebraic like operations on grids Interpolation and Generalization is an inherent part of the raster data representation


Download ppt "by Ayse Kilic with materials from David G"

Similar presentations


Ads by Google