Lesson 4A overview. Introduction to Map Algebra (4A) Map Algebra functions (4B)

Similar documents
Working with Map Algebra

How does Map Algebra work?

Module 7 Raster operations

Raster Analysis and Functions. David Tenenbaum EEOS 465 / 627 UMass Boston

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

RASTER ANALYSIS GIS Analysis Fall 2013

Cell based GIS. Introduction to rasters

RASTER ANALYSIS S H A W N L. P E N M A N E A R T H D A T A A N A LY S I S C E N T E R U N I V E R S I T Y O F N E W M E X I C O

RASTER ANALYSIS GIS Analysis Winter 2016

Layer Variables for RSF-type Modelling Applications

ENGRG Introduction to GIS

Operators. Java operators are classified into three categories:

Raster Data. James Frew ESM 263 Winter

GEOG 487 Lesson 8: Step-by-Step Activity

Watershed Sciences 4930 & 6920 GEOGRAPHIC INFORMATION SYSTEMS

ECEN 468 Advanced Logic Design

Geographic Information Systems (GIS) Spatial Analyst [10] Dr. Mohammad N. Almasri. [10] Spring 2018 GIS Dr. Mohammad N. Almasri Spatial Analyst

Raster GIS applications

Lab 10: Raster Analyses

Map Math and StaMsMcs

Raster GIS applications Columns

Raster Data Model & Analysis

ESCI 386 IDL Programming for Advanced Earth Science Applications Lesson 1 IDL Operators

Control Structures. CIS 118 Intro to LINUX

Soil texture: based on percentage of sand in the soil, partially determines the rate of percolation of water into the groundwater.

Le L c e t c ur u e e 2 To T p o i p c i s c t o o b e b e co c v o e v r e ed e Variables Operators

Using GIS to Site Minimal Excavation Helicopter Landings

Macro Programming Reference Guide. Copyright 2005 Scott Martinez

Learning the Language - V

Lab 12: Sampling and Interpolation

Data Assembly, Part II. GIS Cyberinfrastructure Module Day 4

Ex. 4: Locational Editing of The BARC

CS251 Programming Languages Handout # 29 Prof. Lyn Turbak March 7, 2007 Wellesley College

Python: Working with Raster Data. Nawajish Noman Elizabeth Graham

ArcCatalog or the ArcCatalog tab in ArcMap ArcCatalog or the ArcCatalog tab in ArcMap ArcCatalog or the ArcCatalog tab in ArcMap

Lab 10: Raster Analyses

Delineating Watersheds from a Digital Elevation Model (DEM)

Spatial Analysis with Raster Datasets

Expressions and Precedence. Last updated 12/10/18

Basic operators, Arithmetic, Relational, Bitwise, Logical, Assignment, Conditional operators. JAVA Standard Edition

Chapter 3: Operators, Expressions and Type Conversion

Unit 3. Operators. School of Science and Technology INTRODUCTION

Module 10 Data-action models

Operators And Expressions

Map Algebra: Getting Started. Nawajish Noman

Department of Computer Science

Using Basic Formulas 4

Getting Started with Spatial Analyst. Steve Kopp Elizabeth Graham

Overview: Programming Concepts. Programming Concepts. Names, Values, And Variables

Overview: Programming Concepts. Programming Concepts. Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript

9 Using Equation Networks

Basic Queries Exercise - Haiti

Geol 588. GIS for Geoscientists II. Zonal functions. Feb 22, Zonal statistics. Interpolation. Zonal statistics Sp. Analyst Tools - Zonal.

Part 6b: The effect of scale on raster calculations mean local relief and slope

Raster Data. James Frew ESM 263 Winter

Getting Started with Spatial Analyst. Steve Kopp Elizabeth Graham

Creating a Crosstab Query in Design View

Pond Distance and Habitat for use in Wildlife Modeling

Lesson 3: Basic Programming Concepts

Shell programming. Introduction to Operating Systems

GIS Fundamentals: Supplementary Lessons with ArcGIS Pro

Scheme Tutorial. Introduction. The Structure of Scheme Programs. Syntax

CRC Website and Online Book Materials Page 1 of 16

Announcements. Lab Friday, 1-2:30 and 3-4:30 in Boot your laptop and start Forte, if you brought your laptop

Microsoft Office Excel Use Excel s functions. Tutorial 2 Working With Formulas and Functions

Learning Log Title: CHAPTER 3: ARITHMETIC PROPERTIES. Date: Lesson: Chapter 3: Arithmetic Properties

Chapter 17. Fundamental Concepts Expressed in JavaScript

GIS: Raster Analysis

9. Elementary Algebraic and Transcendental Scalar Functions

Simple Java Programming Constructs 4

Fundamentals. Fundamentals. Fundamentals. We build up instructions from three types of materials

Welcome to NR402 GIS Applications in Natural Resources. This course consists of 9 lessons, including Power point presentations, demonstrations,

Data handling 3: Alter Process

ArcGIS Enterprise Building Raster Analytics Workflows. Mike Muller, Jie Zhang

Grade 4 ISTEP+ T1 #1-2 ISTEP+ T1 # Identify, describe and draw parallelograms, rhombuses, and ISTEP+ T1 #5-6

QUIZ: What value is stored in a after this

What s New in Imagery in ArcGIS. Presented by: Christopher Patterson Date: September 12, 2017

Notes: Notes: Notes: Notes:

Lab 9. Raster Analyses. Tomislav Sapic GIS Technologist Faculty of Natural Resources Management Lakehead University

End-of-Year Assessment Goals

The PCAT Programming Language Reference Manual

Geoprocessing and georeferencing raster data

Language Basics. /* The NUMBER GAME - User tries to guess a number between 1 and 10 */ /* Generate a random number between 1 and 10 */

JAVA OPERATORS GENERAL

Suitability Modeling with GIS

GO - OPERATORS. This tutorial will explain the arithmetic, relational, logical, bitwise, assignment and other operators one by one.

+ = Spatial Analysis of Raster Data. 2 =Fault in shale 3 = Fault in limestone 4 = no Fault, shale 5 = no Fault, limestone. 2 = fault 4 = no fault

Grade 4 Math. construct geometric figures (I) 9A.8

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal

B E C Y. Reference Manual

Operators Functions Order of Operations Mixed Mode Arithmetic VOID Data. Syntax and type conventions Using the Script window interface

Lesson 3: Arithmetic & Casting. Pic 10A Ricardo Salazar

C++ Programming: From Problem Analysis to Program Design, Third Edition

CS109A ML Notes for the Week of 1/16/96. Using ML. ML can be used as an interactive language. We. shall use a version running under UNIX, called

Excel Lesson 3 USING FORMULAS & FUNCTIONS

Introduction. Following are the types of operators: Unary requires a single operand Binary requires two operands Ternary requires three operands

Informatics Ingeniería en Electrónica y Automática Industrial

JME Language Reference Manual

GEO 465/565 Lab 6: Modeling Landslide Susceptibility

Map Analysis of Raster Data I 3/8/2018

Transcription:

Map Algebra

Lesson 4A overview Introduction to Map Algebra (4A) Language components Syntax and rules Objects Operators Commands Exercise 5A Map Algebra functions (4B) 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 hundred User interface implements some, like SLOPE Rules - For building expressions and using functions

Map Algebra geoprocessing tools Single Output Map Algebra Square brackets are ok Output path: Appears on the tool Single output raster Multi Output Map Algebra Output path: Set in Environment Settings dialog Three Output Rasters

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 3 6 9 + = Layer1 Layer2 Outgrid 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 42 4 for all output cells

Map Algebra objects Objects used in expressions or as function arguments Raster as layers or paths Vector as paths SLOPE (Elevation) SLOPE (a:\student student\database\arelev) SHAPEGRID (a:\student student\database\avroad.shp) 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 convenience

User attributes in expressions You may use numeric VAT fields in expressions Reference with Layer.field notation Vegetation.vat Soil.vat Value Count Desc Suit Value Count Desc Suit 101 2450 Grass 1 23 2450 Sand 2 201 65780 Mixed 3 46 65780 Loam 1 301 401 32187 5433 Pine Oak 2 5 87 99 32187 5433 Clay Rock 6 9 Vegetation.suit + soil.suit 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

Special cell values in Map Algebra Logical - Non-zero values are True, zero is False 3 2 1 1 3 0 2 4 0 2 1 3 6 4 1 3 2 0 0 2 4 4 5 1 0 As values T T T T T F T T F T T T T T T T T F F T T T T T F As True/False 1 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 As Logical NoData - If any input is NoData,, the output is NoData 1 1 1 1 1 ND 1 1 ND 1 1 1 1 1 1 1 1 NDND 1 1 1 1 1 ND 3 3 3 3 3 ND 3 NDND 2 2 2 1 1 1 ND 1 NDND 1 1 1 2 1 ND + = 4 4 4 4 4 ND 4 NDND 3 3 3 2 2 2 ND 2 NDND 2 2 2 3 2 ND Layer1 Layer2 Layer3

Map Algebra operators Boolean Work with two inputs, like Slope GE 10 ^, 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 Arithmetic + Addition - Subtraction * Multiplication /, DIV Division MOD Modulus - Unary minus COR Combinatorial Or CAND Combinatorial And CXOR Combinatorial XOR Logical DIFF Logical difference IN {list} Contained in list OVER Replace

Examples of operators Using EQ to find changes in lad use 3 3 3 3 3 3 3 3 3 4 3 3 3 4 4 3 3 4 4 4 4 4 4 4 4 LU90 EQ 3 3 3 3 3 3 3 3 3 4 3 3 3 4 4 3 3 5 5 5 4 4 5 5 5 LU95 Using over to update land use 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 0 0 0 LUDIFF 0 0 0 0 0 0 0 4 0 0 0 4 4 4 0 0 0 4 0 0 0 0 0 0 0 OVER 3 3 3 3 3 3 3 3 3 4 3 3 3 4 4 3 3 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 4 3 4 3 4 4 4 4 3 3 4 4 4 4 4 4 4 4 NewMall LU90 LU_update

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 4A overview Work with Map Algebra Operators Objects Commands

Lesson 4B overview Introduction to Map Algebra (4A) Language components Syntax and rules Objects Operators Commands Exercise 4A Map Algebra functions (4B) 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 By Cell By neighborhood Zonal Global By zone By 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:( 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 xxx(inlayer, neighborhood,, (DATA NODATA))

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

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

Global functions May access all input cells to compute output cell value Mostly do distance REGIONGROUP assigns unique ld s 23 23 13 13 13 23 23 23 13 13 45 45 23 13 13 45 45 23 23 13 45 45 23 23 23 Vegetation Zones 1 1 2 2 2 1 1 1 2 2 3 3 1 2 2 3 3 1 1 2 3 3 1 1 1 Regions with unique ID s REGIONGROUP(Vegetatation)

The CON function IF-THEN THEN-ELSE ELSE function for Map Algebra CON(<condition>, <true_expression< true_expression>, {false_expression{ false_expression}) IF TEST THEN(TEST= 1) ELSE(TEST=O) May be a simple IF-THEN THEN-ELSEELSE 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) ) ) First CON {false expression} Second CON {false_expression{ false_expression}

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

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