Extending ArcGIS using programming David Tarboton GIS in Water Resources 22 October 2013.

Slides:



Advertisements
Similar presentations
JTX Overview Overview of Job Tracking for ArcGIS (JTX)
Advertisements

Environmental GIS Nicholas A. Procopio, Ph.D, GISP Some slides from Lyna Wiggins (Rutgers University)
Why python? Automate processes Batch programming Faster Open source Easy recognition of errors Good for data management What is python? Scripting programming.
Standard watershed and stream delineation recipe - Vector stream (ex. NHD data) fusion into DEM raster (burning in) - Sink removal - Flow direction - Flow.
GIS Topics and Applications
Concept Course on Spatial Dr. A.K.M. Saiful Islam Application of GIS in Watershed Analysis Dr. A.K.M. Saiful Islam Institute of Water and Flood.
Geographic Information Systems : Data Types, Sources and the ArcView Program.
ModelBuilder In ArcGIS 9.x By Tim Weigel GEOG 407/607 April 3 rd, 2006.
Some Potential Terrain Analysis Tools for ArcGIS David G. Tarboton
Spatial Analysis, Geoprocessing,
Geography 465 Overview Geoprocessing in ArcGIS. MODELING Geoprocessing as modeling.
1 CEE 795 Water Resources Modeling and GIS Session #1 (some material from Dr. David Maidment, University of Texas) January 18, 2006 Learning Objectives:
What Geoprocessing? Geoprocessing is the processing of geographic information. Commonly used to describe a process when geographic objects are manipulated.
ModelBuilder at ArcGIS 9.2 Lyna Wiggins Rutgers University May 2008.
Remote Sensing and GIS in Water Dr. A.K.M. Saiful Islam Hands on training on surface hydrologic analysis using GIS Dr. A.K.M. Saiful Islam.
Marine GIS Applications using ArcGIS Global Classroom training course Marine GIS Applications using ArcGIS Global Classroom training course By T.Hemasundar.
GIS in Water Resources: Lecture 1
Rebecca Boger Earth and Environmental Sciences Brooklyn College.
Building a Water Well Database for GIS Analysis By A. Wayne Jones, Kelly A. Barrett Ohio Department of Natural Resources Division of Water.
Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions.
Welcome to Mapping Tom Sellsted – City of Yakima, Washington Vladimir Strinski – Hitech Systems.
Lecture 4 Data. Why GIS? Ask questions Solve a problem Support a decision Make Maps Involve others, share data, procedures, ideas.
ArcGIS Workflow Manager An Introduction
Enterprise ETL & the Home Again
Esri International User Conference | San Diego, CA Technical Workshops | Python – Getting Started Drew Flater, Ghislain Prince July 12 - July 14, 2011.
ESRM 250 & CFR 520: Introduction to GIS © Phil Hurvitz, KEEP THIS TEXT BOX this slide includes some ESRI fonts. when you save this presentation,
Introduction to Spatial Analysis and Spatial Modeling
Introduction to ArcPy. Topics What is ArcPy? Accessing geoprocessing tools using ArcPy Writing scripts using ArcPy.
Python: An Introduction
material assembled from the web pages at
ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Advanced Terrain Analysis Concepts n Specific Catchment Area n The D  Surface Flow Model n Topmodel u Terrain based calculations of saturated areas and.
Expanding the Functionality of ArcGIS Through Tool Building
Advanced Terrain Analysis Concepts n Specific Catchment Area n The D  Surface Flow Model n Topmodel u Terrain based calculations of saturated areas and.
GIS & Health ESPM 9: W 5-8 April 7, 2010 Instructors: Maggi Kelly Kevin Koy Mark O’Connor Geospatial Innovation Facility College of Natural Resources -
1 Overview Importing data from generic raster files Creating surfaces from point samples Mapping contours Calculating summary attributes for polygon features.
USU, RENCI, BYU, UNC, UVA, CUAHSI, Tufts, Texas, Purdue, Caktus
Extending ArcGIS using programming
Python: Building Geoprocessing Tools David Wynne, Ghislain Prince.
William Perry U.S. Geological Survey Western Ecological Research Center Geography 375 Final Project May 22, 2013.
Extending ArcGIS using programming
Extending ArcGIS via programming
Hydrologic Terrain Processing Using Parallel Computing
ArcGIS Workflow Manager: Advanced Workflows and Concepts
Hydrologic Terrain Processing Using Parallel Computing
Flow field representations for a grid DEM
Extending ArcGIS using programming
Extending ArcGIS using programming
PYTHON: AN INTRODUCTION
Environmental GIS Nicholas A. Procopio, Ph.D, GISP
ArcGIS Topology Shapefiles, Coverages, Geodatabases
Terrain Analysis for Water Quality Modeling
Lecture 22: Using ArcToolbox Tools in Python
Raster Analysis and Terrain Analysis
Terrain Analysis Using Digital Elevation Models (TauDEM) in Hydrology
Automation of Input data preparation of TOPNET model using Python
Digital Elevation Model Based Watershed and Stream Network Delineation
Bug in Flow Direction in Ex3 data
Digital Elevation Model Based Watershed and Stream Network Delineation
Digital Elevation Models and Hydrology
Kimberly A. T. Schreuders
Review- vector analyses
Terrain Analysis Using Digital Elevation Models (TauDEM)
Terrain analysis and the modeling of catchment architecture
Digital Elevation Models and Hydrology
Terrain Analysis Using Digital Elevation Models
PYTHON: BUILDING GEOPROCESSING TOOLS
Network Analyst – Automating Workflows with Geoprocessing
Extending ArcGIS using programming
Esri Production Mapping: An Introduction
Presentation transcript:

Extending ArcGIS using programming David Tarboton GIS in Water Resources 22 October 2013

Why Programming Automation of repetitive tasks (workflows) Implementation of functionality not available (programming new behavior)

ArcGIS programming entry points Model builder Python scripting environment ArcObjects library (for system language like C++,.Net) Open standard data formats that anyone can use in programs (e.g. shapefiles, geoTIFF, netCDF)

Geodatabase view: Structured data sets that represent geographic information in terms of a generic GIS data model. Geovisualization view: A GIS is a set of intelligent maps and other views that shows features and feature relationships on the earth's surface. "Windows into the database" to support queries, analysis, and editing of the information. Geoprocessing view: Information transformation tools that derive new geographic data sets from existing data sets. Three Views of GIS adapted from

_is_ModelBuilder/002w /

An example – time series interpolation Soil moisture at 8 sites in field Hourly for a month ~ 720 time steps What is the spatial pattern over time Data from Manal Elarab

How to use in ArcGIS Time series in Excel imported to Object class in ArcGIS Joined to Feature Class (one to many)

Time enabled layer with 4884 records that can be visualized using time slider

But what if you want spatial fields Interpolate using spline or inverse distance weight at each time step Analyze resulting rasters 30 days – 720 hours ??? A job for programming

The program workflow Set up inputs Get time extents from the time layer Create a raster catalog (container for raster layers) For each time step – Query and create layer with data only for that time step – Create raster using inverse distance weight – Add raster to raster catalog Add date time field and populate with time values

I used PyScripter (as suggested by an ESRI programmer

This shows the reading of time parameters and creation of raster catalog

This shows the iterative part

The result

TauDEM Stream and watershed delineation Multiple flow direction flow field Calculation of flow based derivative surfaces MPI Parallel Implementation for speed up and large problems Open source platform independent C++ command line executables for each function Deployed as an ArcGIS Toolbox with python scripts that drive command line executables

Model Builder Model to Delineate Watershed using TauDEM tools

Catchments linked to Stream Network

D-Infinity Contributing Area Tarboton, D. G., (1997), "A New Method for the Determination of Flow Directions and Contributing Areas in Grid Digital Elevation Models," Water Resources Research, 33(2): ) DD D8D8

Generalization to Flow Algebra P ki i Replace by general function

Useful for a tracking contaminant or compound subject to decay or attenuation

SupplyCapacityTransportDeposition 22 )tan(bT cap aa    },min{ capinout TTST   in TTSD Transport limited accumulation Useful for modeling erosion and sediment delivery, the spatial dependence of sediment delivery ratio and contaminant that adheres to sediment S Flow Algebra provides a general modeling framework for static flow field based geospatial concepts

TauDEM Parallel Approach MPI, distributed memory paradigm Row oriented slices Each process includes one buffer row on either side Each process does not change buffer row

Parallelization of Flow Algebra Executed by every process with grid flow field P, grid dependencies D initialized to 0 and an empty queue Q. FindDependencies(P,Q,D) for all i for all k neighbors of i if P ki >0 D(i)=D(i)+1 if D(i)=0 add i to Q next Executed by every process with D and Q initialized from FindDependencies. FlowAlgebra(P,Q,D, ,  ) while Q isn’t empty get i from Q  i = FA(  i, P ki,  k,  k ) for each downslope neighbor n of i if P in >0 D(n)=D(n)-1 if D(n)=0 add n to Q next n end while swap process buffers and repeat 1. Dependency grid2. Flow algebra function

Programming C++ Command Line Executables that use MPI ArcGIS Python Script Tools Python validation code to provide file name defaults Shared as ArcGIS Toolbox

while(!que.empty()) { //Takes next node with no contributing neighbors temp = que.front(); que.pop(); i = temp.x;j = temp.y; // FLOW ALGEBRA EXPRESSION EVALUATION if(flowData->isInPartition(i,j)){ float areares=0.; // initialize the result for(k=1; k<=8; k++) { // For each neighbor in = i+d1[k]; jn = j+d2[k]; flowData->getData(in,jn, angle); p = prop(angle, (k+4)%8); if(p>0.){ if(areadinf->isNodata(in,jn))con=true; else{ areares=areares+p*areadinf->getData(in,jn,tempFloat); } // Local inputs areares=areares+dx; if(con && contcheck==1) areadinf->setToNodata(i,j); else areadinf->setData(i,j,areares); // END FLOW ALGEBRA EXPRESSION EVALUATION } Q based block of code to evaluate any “flow algebra expression” C++

while(!finished) { //Loop within partition while(!que.empty()) {....// FLOW ALGEBRA EXPRESSION EVALUATION } // Decrement neighbor dependence of downslope cell flowData->getData(i, j, angle); for(k=1; k<=8; k++) { p = prop(angle, k); if(p>0.0) { in = i+d1[k]; jn = j+d2[k]; //Decrement the number of contributing neighbors in neighbor neighbor->addToData(in,jn,(short)-1); //Check if neighbor needs to be added to que if(flowData->isInPartition(in,jn) && neighbor->getData(in, jn, tempShort) == 0 ){ temp.x=in; temp.y=jn; que.push(temp); } //Pass information across partitions areadinf->share(); neighbor->addBorders(); Maintaining to do Q and partition sharing C++

Python Script to Call Command Line mpiexec –n 8 pitremove –z Logan.tif –fel Loganfel.tif

PitRemove Python

Validation code to add default file names Python

Summary GIS and Water Resources analysis capabilities are readily extensible with programming to do something new to repeat something needed frequently Model builder provides visual programming and helps learn ArcGIS python commands Python – cross platform, powerful and easy to use is a good programming language to start with (when your time is valuable) Compiled language programming for developers (C++) to achieve optimal efficiency (when the computers time is valuable)