Python Raster Analysis

Similar documents
Python - Raster Analysis

Python Raster Analysis. Kevin M. Johnston Nawajish Noman

Python Raster Analysis. Kevin M. Johnston Nawajish Noman

Working With Raster Data Using Python. Nawajish Noman Ryan DeBruyn

Python: Working with Raster Data

Python: Working with Raster Data. Nawajish Noman Elizabeth Graham

ArcGIS Spatial Analyst Suitability Modeling

Designing and Using Cached Map Services

Esri International User Conference. San Diego, California. Technical Workshops. July Creating Surfaces. Steve Kopp and Steve Lynch

Getting Started with Spatial Analyst. Steve Kopp Elizabeth Graham

Getting Started with Spatial Analyst. Steve Kopp Elizabeth Graham

Surface Analysis with 3D Analyst

Map Algebra: Getting Started. Nawajish Noman

PYTHON. Scripting for ArcGIS. writeoutput = Inputfc = ar. .ext.{) OUtpUt fc =.. Paul A. Zandbergen. axcpy random. .arcpy, Describe (' is.

Automating Geodatabase Creation with Geoprocessing

Python Map Automation Beyond the Basics of arcpy.mapping

Network Analyst: An Introduction

Surface Creation & Analysis with 3D Analyst

GEOGRAPHIC INFORMATION SYSTEMS Lecture 24: Spatial Analyst Continued

Building Java Apps with ArcGIS Runtime SDK

Working with Scientific Data in ArcGIS Platform

Network Analysis with ArcGIS Online and On-premise Services

Creating Geoprocessing Services and Web Tools. Darren Baird, PE, Esri

An Introduction to Data Interoperability

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

Developing Qt Apps with the Runtime SDK

RASTER ANALYSIS GIS Analysis Winter 2016

Customizing the Operations Dashboard for ArcGIS

Network Analyst: Performing Network Analysis

Python Getting Started

Using Imagery for Intelligence Analysis

PUG List. Raster Analysis 3D Analysis Geoprocessing. Steve Kopp

ArcPad An Introduction

Spatial Analyst Identifying the Best Paths with Cost Distance Analysis. Kevin M. Johnston Elizabeth Graham

Advanced Parcel Editing. Amy Andis Tim Hodson

An Introduction to Using Lidar with ArcGIS and 3D Analyst

ArcMap: Tips and Tricks

Suitability Modeling with GIS

Data Assembly, Part II. GIS Cyberinfrastructure Module Day 4

Caching Imagery Using ArcGIS

Esri Production Mapping An Introduction

RASTER ANALYSIS GIS Analysis Fall 2013

Lidar Working with LAS Datasets

Introduction to the Image Analyst Extension. Mike Muller, Vinay Viswambharan

Using Python with ArcGIS

Working with Metadata in ArcGIS

Lecture 9. Raster Data Analysis. Tomislav Sapic GIS Technologist Faculty of Natural Resources Management Lakehead University

Managing Imagery and Raster Data Using Mosaic Datasets

Raster Analytics in Image Server: An Introduction. Mike Muller

Best Practices for Designing Effective Map Services

Network Analyst Creating Network Datasets

ArcGIS Desktop: Introduction to Geoprocessing with ModelBuilder Kevin Armstrong ESRI

STUDENT PAGES GIS Tutorial Treasure in the Treasure State

Esri International User Conference. July San Diego Convention Center. Lidar Solutions. Clayton Crawford

ModelBuilder: An Introduction. Kevin Armstrong

Using GIS To Estimate Changes in Runoff and Urban Surface Cover In Part of the Waller Creek Watershed Austin, Texas

An Introduction to Dynamic Simulation Modeling

ArcMap Tips and Tricks

ArcGIS Desktop The Road Ahead. Amadea Azerki

Data Interoperability An Introduction

Using Python with ArcGIS

Creating Surfaces. Steve Kopp Steve Lynch

Parallel Python: Multiprocessing With ArcPy. Clinton Dow Geoprocessing Neeraj Rajasekar Spatial Analyst

GEOGRAPHIC INFORMATION SYSTEMS Lecture 18: Spatial Modeling

Python: Working with Multidimensional Scientific Data. Nawajish Noman Deng Ding

Automating Distributed Raster Analysis using the Image Server REST API. Jie Zhang Zikang Zhou Demo Theater 2 - Oasis 1

Administering Your Microsoft SQL Server Geodatabase

Raster Analysis and Image Processing in ArcGIS Enterprise

Suitability Analysis in Raster GIS. Combining Multiple Maps

Distributed Image Analysis Using the ArcGIS API for Python

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

Scientific and Multidimensional Raster Support in ArcGIS

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

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

Module 7 Raster operations

ArcGIS Runtime SDK for ios and macos: Building Apps. Suganya Baskaran, Gagandeep Singh

Building Applications with the ArcGIS Runtime SDK for WPF

INTRODUCTION TO GIS WORKSHOP EXERCISE

Creating raster DEMs and DSMs from large lidar point collections. Summary. Coming up with a plan. Using the Point To Raster geoprocessing tool

ArcGIS 10.1 for Desktop Artie Robinson

hereby recognizes that Timotej Verbovsek has successfully completed the web course 3D Analysis of Surfaces and Features Using ArcGIS 10

ArcGIS Viewer for Microsoft Silverlight An Introduction

Watershed Sciences 4930 & 6920 GEOGRAPHIC INFORMATION SYSTEMS

What s New in Desktop 10.1

ENGRG Introduction to GIS

Introduction to 3D Analysis. Jinwu Ma Jie Chang Khalid Duri

Python: Beyond the Basics. Michael Rhoades

Topology in the Geodatabase an Introduction. Erik Hoel Doug Morgenthaler

Creating Mosaic Datasets and Publishing Image Services using Python

ArcGIS Pro: Mapping & Visualization. David Watkins, Edie Punt &

Spatial Analysis (Vector) II

ArcGIS Pro: Image Segmentation, Classification, and Machine Learning. Jeff Liedtke and Han Hu

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

Lidar and GIS: Applications and Examples. Dan Hedges Clayton Crawford

What s s Coming in ArcGIS 10 Desktop

ArcGIS Viewer for Flex Advanced Topics

Python: Working with Feature Data. Ghislain Prince David Wynne

Outline Overview of Spatiotemporal data Storage and management of temporal data Feature Raster Array (netcdf) Visualization of temporal data Analysis

Lab 1: Exploring ArcMap and ArcCatalog In this lab, you will explore the ArcGIS applications ArcCatalog and ArcMap. You will learn how to use

Publishing image services in ArcGIS

Transcription:

2013 Esri International User Conference July 8 12, 2013 San Diego, California Technical Workshop Python Raster Analysis Kevin M. Johnston Ryan DeBruyn Nawajish Noman Esri UC2013. Technical Workshop.

The problem that is being addressed You have a complex modeling problem You are mainly working with rasters Some of the spatial manipulations that you trying to implement are difficult or not possible using standard ArcGIS tools Due to the complexity of the modeling problem, processing speed is a concern

Outline Managing rasters and performing analysis with Map Algebra How to access the analysis capability Demonstration Complex expressions and optimization Demonstration Additional modeling capability: classes Demonstration Full modeling control: NumPy arrays Demonstration Pre-10 Map Algebra

The complex model Emerald Ash Borer Originated in Michigan Infest ash trees 100% kill Coming to Vermont

The Ash Borer model Movement by flight - 20 km per year - Vegetation type and ash density (suitability surface) Movement by hitchhiking - Roads - Camp sites - Mills - Population - Current location of the borer (suitability surface) Random movement

The Ash Borer model Prepare the data An iterative model based on a year Three sub models run individually each iteration and the results are combined - Movement by flight (run 3 different seasons) - Movement by hitchhiking (run once) - Random movement (run once)

Raster analysis Preparing the data To prepare and manage raster data - Displaying - Adding, copying, deleting, etc. - Mosaic, Clip, etc. - Raster object - NumPy, ApplyEnvironment, etc. To perform analysis - Spatial Analyst - Map Algebra

What is Map Algebra Simple and powerful algebra to execute Spatial Analyst tools, operators, and functions to perform geographic analysis The strength is in creating complex expressions Available through Spatial Analyst module Integrated in Python (all modules available)

Importing Spatial Analyst Module of ArcPy site package Like all modules must be imported To access the operators and tools in an algebraic format the imports are important import arcpy from arcpy.sa import *

General syntax Map Algebra available through an algebraic format Simplest form: output raster is specified to the left of an equal sign and the tool and its parameters on the right from arcpy.sa import * outras = Slope(indem) Comprised of: - Input data - Operators - Tools - Parameters - Output

Input data Input elements - Dataset name or layer - Dataset with full path - Variable pointing to a raster - Raster object - Numbers and constants outras = Slope(inRaster) Tip: It is good practice to set the input to a variable and use the variable in the expression. Dataset names are quoted. inraster1 = "C:/Data/elevation" outras = Slope(inRaster1)

Map Algebra operators Symbols for mathematical operations Many operators in both Python and Spatial Analyst Creating a raster object (Raster class) indicates operator should be applied to rasters elevmeters = Raster("C:\data\elevation") * 0.3048 outslope = Slope(elevMeters)

Map Algebra tools All Spatial Analyst tools are available (e.g., Sin, Slope, Reclassify, etc.) outras = Aspect(inRaster) Can use any Geoprocessing tools Tip: Tool names are case sensitive

Tool parameters Defines how the tool is to be executed Each tool has its own unique set of parameters Some are required, others are optional Numbers, strings, and objects (classes) outras = Slope(inRaster, "PERCENT_RISE", 0.3048)

Map Algebra output Stores the results as a Raster object Object with methods and properties In scripting the output is temporary Associated data will be deleted if not explicitly saved outras = Hillshade(inRaster)

Access to Map Algebra Raster Calculator - Spatial Analyst tool - Easy to use calculator interface - Stand alone or in ModelBuilder Python window - Single expression or simple exploratory models Scripting - Complex models - Line completion and colors

The Ash Borer model Prepare the data An iterative model based on a year Three sub models run individually each iteration and the results are combined - Movement by flight (run 3 different seasons) - Movement by hitchhiking (run once) - Random movement (run once)

Demo 1: Data management Raster management tools Raster Calculator Python window ModelBuilder Simple expressions Esri UC2013. Technical Workshop.

Outline Managing rasters and performing analysis with Map Algebra How to access the analysis capability Demonstration Complex expressions and optimization Demonstration Additional modeling capability: classes Demonstration Full modeling control: NumPy arrays Demonstration Pre-10 Map Algebra

Complex expressions Multiple operators and tools can be implemented in a single expression Output from one expression can be input to a subsequent expression inraster = ExtractByAttributes(inElevation, "Value > 1000") out = Con(IsNull(inRaster), 0, inraster)

More on the raster object A variable with a pointer to a dataset Output from a Map Algebra expression or from an existing dataset The associated dataset is temporary (from Map Algebra expression) - has a save method outras = Slope(inRaster) outras.save("sloperaster") Properties describing the associated dataset - Description of raster (e.g., number of rows) - Description of the values (e.g., mean)

Optimization A series of local tools (Abs, Sin, CellStatistics, etc.) and operators can be optimized When entered into a single expression each tool and operator is processed on a per cell basis

The Ash Borer model Prepare the data An iterative model based on a year Three sub models run individually each iteration and the results are combined - Movement by flight (run 3 different seasons) - Movement by hitchhiking (run once) - Random movement (run once)

Movement by hitchhiking Hitchhike on cars and logging trucks Most likely spread around - Roads - Populated areas (towns and camp areas) - Commercial area (mills) Have a susceptible surface - Vegetation types and density of ash Nonlinear decay Random points and check susceptibility

Demo 2: Movement by hitchhiking Roads, Campsites, Mills, Population,and current location (suitability) Complex expressions Raster object Optimization Esri UC2013. Technical Workshop.

Outline Managing rasters and performing analysis with Map Algebra How to access the analysis capability Demonstration Complex expressions and optimization Demonstration Additional modeling capability: classes Demonstration Full modeling control: NumPy arrays Demonstration Pre-10 Map Algebra

Classes Objects that are used as parameters to tools - Varying number of arguments depending on the parameter choice (neighborhood type) - The number of entries can vary depending on situation (remap table) More flexible Query the individual arguments

Classes - Categories General - Fuzzy - Time - Horizontal Factor - Vertical Factor - KrigingModel - Radius - Neighborhood Composed of lists - Reclass - Weighted reclass tables - Topo

General classes some capability Creating neigh = NbrCircle(4, "MAP") Querying radius = neigh.radius Changing arguments neigh.radius = 6

Classes composed of lists Topo incontours = TopoContour([['contours.shp', 'spot_meter']]) Reclassify remap = RemapValue([["Brush/transitional", 0], ["Water", 1],["Barren land", 2]]) Weighted Overlay mywotable = WOTable([[inRaster1, 50, "VALUE", remapsnow], [inraster2, 20, "VALUE", remapland], [inraster3, 30, "VALUE", remapsoil] ], [1, 9, 1])

Vector integration Feature data is required for some Spatial Analyst Map Algebra - IDW, Kriging, etc. Geoprocessing tools that operate on feature data can be used in an expression - Buffer, Select, etc. dist = EucDistance(arcpy.Select_analysis("schools", "#", "Pop>2000"))

The Ash Borer model Prepare the data An iterative model based on a year Three sub models run individually each iteration and the results are combined - Movement by flight (run 3 different seasons) - Movement by hitchhiking (run once) - Random movement (run once)

Movement by flight Fly from existing locations - 20 km per year Based on iterative time steps - Spring, summer, fall, and winter Time of year determines how far it can move in a time step Suitability surface based on vegetation type and ash density Iterative movement logic - Is there a borer in my neighborhood - Will I accept it suitability surface

Demo 3: Movement by flight 20 km per year Vegetation type/ash density (suitability) Classes Using variables Vector integration Esri UC2013. Technical Workshop.

Outline Managing rasters and performing analysis with Map Algebra How to access the analysis capability Demonstration Complex expressions and optimization Demonstration Additional modeling capability: classes Demonstration Full modeling control: NumPy arrays Demonstration Pre-10 Map Algebra

NumPy Arrays A generic Python storage mechanism Create custom tool Access the wealth of free tools built by the scientific community - Clustering - Filtering - Linear algebra - Optimization - Fourier transformation - Morphology

NumPy Arrays Two tools - RasterToNumPyArray - NumPyArrayToRaster Raster 1 3 2 4 3 4 1 3 2 4 3 4 NumPy Array

The Ash Borer model Prepare the data An iterative model based on a year Three sub models run individually each iteration and the results are combined - Movement by flight (run 3 different seasons) - Movement by hitchhiking (run once) - Random movement (run once)

Random movement Some of the movement cannot be described deterministically Nonlinear decay from known locations Specific decay function not available in ArcGIS NumPy array - Export raster - Apply function - Import NumPy array back into a raster Return to ash borer model and integrate three movement sub models

Demo 4: The random movement Random movement based on nonlinear decay from existing locations Custom function NumPy array Esri UC2013. Technical Workshop.

Outline Managing rasters and performing analysis with Map Algebra How to access the analysis capability Demonstration Complex expressions and optimization Demonstration Additional modeling capability: classes Demonstration Full modeling control: NumPy arrays Demonstration Pre-10 Map Algebra

Pre-10.0 Map Algebra Similar to Map Algebra 10.0 Faster, more powerful, and easy to use (line completion, colors) Any changes are to take advantage of the Python integration Raster Calculator at 10.0 replaces the Raster Calculator from the tool bar, SOMA, and MOMA SOMA in existing models will still work

Spatial Analyst - Technical Sessions An Introduction - Rm 03 Tuesday, July 9, 8:30AM 9:45AM Wednesday, July 10, 1:30PM 2:45PM Suitability Modeling - Rm 03 Tuesday, July 9, 10:15 AM 11:30PM Wednesday, July 10, 3:15PM 4:30PM Python Raster Analysis - Rm 03 Tuesday, July 9, 3:15PM 4:30PM Thursday, July 11, 8:30AM 9:45PM Creating Surfaces Rm 03 Wednesday, July 10, 8:30AM 9:45PM Esri UC2013. Technical Workshop.

Spatial Analyst Technical Sessions (short) Creating Watersheds and Stream Networks Rm 31C Thursday, July 11, 10:15AM 11:45AM Regression Analysis Using Raster Data Hall G Rm 2 Wednesday, July 10, 10:30AM 11:00AM Esri UC2013. Technical Workshop.

Demo Theater Presentations Exhibit Hall B Modeling Rooftop Solar Energy Potential Tuesday, July 9, 5:30PM 6:00PM Surface Interpolation in ArcGIS Wednesday, July 10, 4:30PM 5:30PM Getting Started with Map Algebra Tuesday, July 9, 10:00AM 11:00AM Agent-Based Modeling Wednesday, July 10, 1:00PM 2:00PM Image Classification with Spatial Analyst Tuesday July 9, 3:00PM 3:30PM Esri UC2013. Technical Workshop.

Thank you Please fill out the session evaluation First Offering ID: 1190 Second Offering ID: 1390 Online www.esri.com/ucsessionsurveys Paper pick up and put in drop box