Map Algebra. Lesson 5A overview  Introduction to Map Algebra (5A)  Language components  Syntax and rules  Objects  Operators  Commands  Exercise.

Slides:



Advertisements
Similar presentations
Intermediate Code Generation
Advertisements

Introduction to C Programming
 2000 Prentice Hall, Inc. All rights reserved. Chapter 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line.
Using ESRI ArcGIS 9.3 Arc ToolBox 3 (Spatial Analyst)
CS 3850 Lecture 5 Operators. 5.1 Binary Arithmetic Operators Binary arithmetic operators operate on two operands. Register and net (wire) operands are.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie June 27, 2005.
Raster Analysis Raster math Topography: Slope, aspect, contours Reclassify Raster / Vector Conversions Statistics: min, max, mean, std. dev. –Local, Neighborhood,
Fall 2006AE6382 Design Computing1 Relational and Logical Operators Use relational operators to test two values Work with values of true and false Compare.
Raster Data Analysis Chapter 11. Introduction  Regular grid  Value in each cell corresponds to characteristic  Operations on individual, group, or.
C++ Operators CS242 COMPUTER PROGRAMMING T.Banan Al-Hadlaq.
WEB DESIGN AND PROGRAMMING Introduction to Javascript.
Chapter 4: Operators Department of Computer Science Foundation Year Program Umm Alqura University, Makkah Computer Programming Skills /1436.
ESRM 250 & CFR 520: Introduction to GIS © Phil Hurvitz, KEEP THIS TEXT BOX this slide includes some ESRI fonts. when you save this presentation,
MSc in Geoinformatics – Managing Energy, Resources, Environment Teacher Training Dushanbe, – TEMPUS This project has.
Applied Cartography and Introduction to GIS GEOG 2017 EL
Focal and Zonal Functions RNR 419/519. Focal Functions Focal (or neighborhood) functions compute an output grid in which the output value at each cell.
CHAPTER 12 RASTER DATA ANALYSIS 12.1 Data Analysis Environment
Assignment 3 Cartographic Modeling –Raw Spatial Data  Map Product for Decision Making Steps –Define Goal –Define important social or biophysical factors.
Intro to Raster GIS GTECH361 Lecture 11. CELL ROW COLUMN.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 2 Chapter 2 - Introduction to C Programming.
Raster Concepts.
Introduction to C Programming Angela Chih-Wei Tang ( 唐 之 瑋 ) Department of Communication Engineering National Central University JhongLi, Taiwan 2010 Fall.
1 Raster Analysis I Overview Grid layers Setting grid layer and analysis properties Grid function types Performing grid analysis Map Algebra GEO4152 Applications.
CPS120: Introduction to Computer Science Operations Lecture 9.
Lecture 2: Introduction to C Programming. OBJECTIVES In this lecture you will learn:  To use simple input and output statements.  The fundamental data.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
Copyright © 2006 by Maribeth H. Price 15-1 Chapter 15 Raster Analysis.
Raster Analysis. Learning Objectives Develop an understanding of the principles underlying lab 4 Introduce raster operations and functions Show how raster.
Query and Reasoning. Types of Queries Most GIS queries will select spatial features Query by Attribute (Select by Attribute) –Structured Query Language.
NR 143 Study Overview: part 1 By Austin Troy University of Vermont Using GIS-- Introduction to GIS.
1 Overview Importing data from generic raster files Creating surfaces from point samples Mapping contours Calculating summary attributes for polygon features.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Access Queries Agenda 6/16/14 Review Access Project Part 1, answer questions Discuss queries: Turning data stored in a database into information for decision.
CFR 250/590 Introduction to GIS, Autumn 1999 Raster Analysis I © Phil Hurvitz, raster1.ppt 1  Overview Grid themes Setting grid theme and analysis.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 2 - Introduction to C Programming Outline.
Spatial Analysis with Raster Datasets-1 Francisco Olivera, Ph.D., P.E. Srikanth Koka Department of Civil Engineering Texas A&M University.
ECE 103 Engineering Programming Chapter 4 Operators Herbert G. Mayer, PSU CS Status 6/19/2015 Initial content copied verbatim from ECE 103 material developed.
STRUCTURED PROGRAMMING C++ Operators. Content 2  C++ operators  Assignment operators  Arithmetic operators  Increment and decrement operators  Decision.
 Most C programs perform calculations using the C arithmetic operators (Fig. 2.9).  Note the use of various special symbols not used in algebra.  The.
An Introduction to Programming with C++ Sixth Edition Chapter 5 The Selection Structure.
1 Lecture 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line of Text 2.3Another Simple C Program: Adding.
Lecture 18: Spatial Analysis Using Rasters Jeffery S. Horsburgh CEE 5190/6190 Geographic Information Systems for Civil Engineers Spring 2016.
LESSON 3 Expressions, Statements, & Operators. STATEMENTS A statement Controls the sequence of execution Evaluates an expression Does nothing (the null.
ECE 103 Engineering Programming Chapter 4 Operators Herbert G. Mayer, PSU Status 6/10/2016 Initial content copied verbatim from ECE 103 material developed.
Chapter 8 Raster Analysis.
Topics Designing a Program Input, Processing, and Output
Spatial Models – Raster Stacy Bogan
Chapter 2 - Introduction to C Programming
Raster Analysis Ming-Chun Lee.
URBDP 422 Urban and Regional Geo-Spatial Analysis
The Selection Structure
Chapter 2 - Introduction to C Programming
Variable Declarations, Data types, Expressions
Chapter 7 - JavaScript: Introduction to Scripting
Review- vector analyses
JavaScript: Introduction to Scripting
Chapter 2 - Introduction to C Programming
Chapter 2 - Introduction to C Programming
Raster Data Analysis.
SELECTIONS STATEMENTS
Topics Designing a Program Input, Processing, and Output
Topics Designing a Program Input, Processing, and Output
Chapter 2 - Introduction to C Programming
Chapter 7 - JavaScript: Introduction to Scripting
Chapter 7 - JavaScript: Introduction to Scripting
DATA TYPES AND OPERATIONS
ICS 101 Lab 3 Hossain Arif ICS Dept
Spatial Analysis with Raster Datasets-1
REPETITION Why Repetition?
Chapter 7 - JavaScript: Introduction to Scripting
Presentation transcript:

Map Algebra

Lesson 5A overview  Introduction to Map Algebra (5A)  Language components  Syntax and rules  Objects  Operators  Commands  Exercise 5A  Map Algebra functions (5B)  Function syntax  Local functions  Focal and Block functions  Zonal functions  Global functions  Exercise 5B

Map Algebra: The language of raster  A data-manipulation language designed for raster  Math-like expressions AqSuit = (SoilSuit * 0.75) ÷ (SlpSuit * 0.25)  Parts of the language:  Objects - Raster, vector, numbers, constants, variables...  Operators – “+”, “-”,“/”,“GT”,“LE”, “AND”, “OR”  Functions - SLOPE, FOCALMEAN, SIN, Central part of the language; over a hundredCentral part of the language; over a hundred User interface implements some, like SLOPEUser interface implements some, like SLOPE  Rules - For building expressions and using functions

Map Algebra geoprocessing tools Single Output Map Algebra Output path: Appears on the tool Multi Output Map Algebra Output path: Set in Environment Settings dialog

Geoprocessing tools vs Model Builder

Expression syntax rules  Delimit operators and objects with blanks Wrong: Layer+Layer2+Layer3 Right: Layer1 + Layer2 + Layer3  Operators are evaluated by precedence level Layer1 + Layer2 * Layer3  Override operator precedence with parentheses (Layer1 + Layer2) * Layer3  Nested parenthetical expressions evaluate first (Layer1 + Layer2) / 4 - Layer3

Expression results  Expressions return grids, vector data, tables, etc.  Depends on functions used  Most expressions return grids  Tools supply default output names  Can rename  Layers added to ArcMap Table of Contents

Expression evaluation  How expressions are processed  1. Define an empty output raster based on the analysis environment  2. Position to the next output cell (start at row 0, column 0)  3. Resample input raster(s) to determine corresponding cell values  4. Evaluate the expression and write the result to the output cell  5. Repeat steps 2—4 for all output cells 369 Layer1 Layer2 Outgrid + =

Map Algebra objects  Objects used in expressions or as function arguments  Raster as layers or paths SLOPE (Elevation) SLOPE (a:\student\database\arelev)  Vector as paths SHAPEGRID (a:\student\database\avroad.slip)  Tables - Output by a few functions  Numbers - Integer or decimal  Scientific notation okay (1.234e 2 is the same as 123.4)  Constants and variables (P1, DEG, $$ROWMAP, $$NROWS, etc.) Built in for your convenienceBuilt in for your convenience

User attributes in expressions  You may use numeric VAT fields in expressions  Reference with Layer.field notation  Layer alone is assumed to be Layer.Value  You may join tables to raster VAT file  Use joined fields for symbology, selection  Cannot use in Map Algebra expressions ValueCountDescSuit Grass Mixed Pine Oak5ValueCountDescSuit232450Sand Loam Clay Rock9 Vegetation.vat Soil.vat Vegetation.suit + soil.suit

Special cell values in Map Algebra  Logical - Non-zero values are True, zero is False  NoData - If any input is NoData, the output is NoData As values TTTTT FTTFT TTTTT TTFFT TTTTF As True/False As Logical ND Layer ND Layer ND Layer3 + =

Map Algebra operators  Work with two inputs, like Slope GE 10 Arithmetic + Addition + Addition - Subtraction * Multiplication * Multiplication /, DIV Division MOD Modulus - Unary minus - Unary minus Boolean ^, NOT Logical complement &, AND Logical And I, OR Logical Or !, XOR Logical Xor Relational = =, EQ Equal ^=, <>, NE Not Equal <, LT Less than <=, LE Less than or equal >, GT Greater than >=, GE Greater than or equal Combinatorial COR Combinatorial Or CAND Combinatorial And CXOR Combinatorial XOR CXOR Combinatorial XOR Logical DIFF Logical difference DIFF Logical difference IN {list} Contained in list OVER Replace

Examples of operators  Using EQ to find changes in lad use  Using over to update land use LU LU LUDIFF EQ NewMall LU LU_update OVER

ArcGIS Spatial Analyst command  There are a few commands  Tasks not suited to functions  Enter in Raster Calculator  Not part of Map Algebra  Cannot use in expressions  Mostly data management  Build attribute tables  Create, manage grid stacks  Others

Exercise 5A overview  Work with Map Algebra  Operators  Objects  Commands

Lesson 5B overview  Introduction to Map Algebra (5A)  Language components  Syntax and rules  Objects  Operators  Commands  Exercise 4A  Map Algebra functions (5B)  Function syntax  Local functions  Focal and Block functions  Zonal functions  Global functions  Exercise 5B

Map Algebra functions  Do most of the work in Map Algebra  About 168 functions  Can classify functions by processing method Local Focal ZonalGlobal By Cell By neighborhood By zoneBy raster

Function syntax rules  Functions return values  Use as “objects” in expressions Farmsoils + CON(S1ope LE 15, 1, 0)  Arguments in parentheses and comma-delimited SLOPE(Elevation, DEGRE)  Arguments may be other functions or expressions* SLOPE (IDW(c:\data\elevpoints, spot), DEGREE)  * If they return the data expected by the argument  * If the function allows it

Local functions  Compute values based on the current output cell  Most functions are local  Each cell is processed, starting at top left

Focal functions  Compute values by cell neighborhoods  Writes result to current cell in the output grid  Neighborhood is a moving window over input  General syntax: FOCALxxx(InLayer, neighborhood, (DATA | NODATA))

Focal neighborhoods  You may define the neighborhood geometry  Create a custom neighborhood with a kernel file FOCALSUM (Elev) FOCALSUM (Elev, Rectangle, 5, 3) FOCALSUM (Elev, Circle, 2) FOCALSUM (Elev, Annulus, 2, 3) FOCALSUM (Elev, wedge, 4, 300, 330) FOCALSUM (Elev) FOCALSUM (Elev, Rectangle, 5, 3) FOCALSUM (Elev, Circle, 2) FOCALSUM (Elev, Annulus, 2, 3) FOCALSUM (Elev, wedge, 4, 300, 330) DefaultRectangleCircleAnnulusWedge Kernel.txt

Zonal functions  Most summarize values in a layer by zones in another  Require two input rasters: Zone and Value PopByDistrict Output layer ZonalSum(District, Population) Zone layerValue layer DistrictPopulation

Global functions  May access all input cells to compute output cell value  Mostly do distance  REGIONGROUP assigns unique lD’s Vegetation Zones Regions with unique ID’s REGIONGROUP(Vegetatation)

The CON function  IF-THEN-ELSE function for Map Algebra CON(,, {false_expression}) IF TEST THEN(TEST= 1) ELSE(TEST=O)  May be a simple IF-THEN-ELSE CON(Slope <20, 1, 0)  Or nest CONs for an ELSE-IF CON(Slope < 20, 1, CON(Slope < 40, 2, CON(Slope < 90, 3, 5) ) ) CON(Slope < 90, 3, 5) ) ) First CON {false expression} Second CON {false_expression}

Working with NoData  ISNULL tests for NoData: Returns true or false  SETNULL assiqns NoData to cells that pass a test ND Output Vegetation ISNULL(Vegetation) ND SETNULL(Landuse EQ 4, Landuse) LanduseOutput

Exercise 5B overview  Work with Map Algebra functions  Work with local functions  Work with focal functions  Work with zonal functions  Work with global functions