Extending ArcGIS via programming

Slides:



Advertisements
Similar presentations
Water Rights Accounting. New Accounting Model New Technology: 1979 versus 2011 – Faster processors – Faster graphics – Larger, faster, memory – Larger,
Advertisements

JTX Overview Overview of Job Tracking for ArcGIS (JTX)
Spatial Analysis with ArcView: 2-D. –Calculating viewshed –Calculating line of sight –Add x and y coordinates –Deriving slope from surface data –Deriving.
Extending ArcGIS using programming David Tarboton GIS in Water Resources 22 October 2013.
Standard watershed and stream delineation recipe - Vector stream (ex. NHD data) fusion into DEM raster (burning in) - Sink removal - Flow direction - Flow.
CEE 795 Water Resources Modeling and GIS Learning Objectives: Perform raster based network delineation from digital elevation models Perform raster based.
Introduction to GIS and ArcGIS How a GIS works Introduction to ArcGIS The ArcGIS Interface.
IS 466 ADVANCED TOPICS IN INFORMATION SYSTEMS LECTURER : NOUF ALMUJALLY 20 – 11 – 2011 College Of Computer Science and Information, Information Systems.
Digital Elevation Model based Hydrologic Modeling Topography and Physical runoff generation processes (TOPMODEL) Raster calculation of wetness index Raster.
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.
Introduction to GIS and ArcGIS How a GIS works Introduction to ArcGIS.
Some Potential Terrain Analysis Tools for ArcGIS David G. Tarboton
Spatial Analysis, Geoprocessing,
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.
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.
ESRM 250/CFR 520 Winter 2010 Phil Hurvitz (with thanks to J. Lawler & P. Schiess) Introduction to GIS and ArcGIS 1 of 48.
GIS in Water Resources: Lecture 1
Rebecca Boger Earth and Environmental Sciences Brooklyn College.
Watershed and Stream Delineation Tool for ArcGIS 8.1 By Milver A. Valenzuela TEXAS A&M UNIVERSITY.
Welcome to Mapping Tom Sellsted – City of Yakima, Washington Vladimir Strinski – Hitech Systems.
Interface data models Model 1 Model 2 Model 3 GIS Geo Database Arc Hydro data model Geographically Integrated Hydrologic Modeling Systems.
Introduction to Spatial Analysis and Spatial Modeling
9. Introduction to ArcObjects Most GIS analysis carried out within a GIS consists of a labor- intensive sequence of steps. Automating a GIS makes it possible.
How do we represent the world in a GIS database?
Advanced Terrain Analysis Concepts n Specific Catchment Area n The D  Surface Flow Model n Topmodel u Terrain based calculations of saturated areas and.
Terrain Stability Mapping Using the ArcView SINMAP extension David G Tarboton, Robert T Pack, Craig N Goodwin Acknowledgements n The SINMAP software was.
GIS Data Structures How do we represent the world in a GIS database?
Digital Elevation Model Based Watershed and Stream Network Delineation
Advanced Terrain Analysis Concepts n Specific Catchment Area n The D  Surface Flow Model n Topmodel u Terrain based calculations of saturated areas and.
Watershed and Stream Network Delineation – Geomorphological Considerations David G. Tarboton
Introduction to GIS. What is GIS? Geographic Information System Geographic implies of or pertaining to the surface of the earth Information implies knowledge.
David Tarboton Digital Elevation Models, Flood Inundation Mapping and River Hydraulic Properties David Tarboton
Digital Elevation Model Based Watershed and Stream Network Delineation n Conceptual Basis n Eight direction pour point model (D8) n Flow accumulation n.
GIS in Water Resources: Lecture 1 The goal of this class is to learn how to apply geographic information systems in water resources. Hydrologists use many.
Extending ArcGIS using programming
Hydrologic Terrain Analysis in ArcGIS
David G. Tarboton Utah State University Ude Shankar NIWA, New Zealand
David G. Tarboton 5/22/2018 Terrain Analysis and Hydrologic Modeling using Digital Elevation Models and GIS David G. Tarboton
Automating parflow preprocessing steps for DEMs
Extending ArcGIS using programming
Grid-Based Modeling with Digital Elevation Models
Watershed and Stream Network Delineation Including Geomorphology
Hydrologic Properties of the Landscape
Computer Modeling/GIS Linkages
Extending ArcGIS using programming
DES 606 : Watershed Modeling with HEC-HMS
Terrain Analysis for Water Quality Modeling
Lecture 22: Using ArcToolbox Tools in Python
GIS, Hydrology and Terrain Analysis Using Digital Elevation Models
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
A Geographic Information System Tool for Hydrologic Model Setup
Digital Elevation Model Based Watershed and Stream Network Delineation
Digital Elevation Models and Hydrology
Writing Geoprocessing Scripts With ArcGIS
Review- vector analyses
Terrain Analysis Using Digital Elevation Models
Writing Geoprocessing Scripts With ArcGIS
Advances in the mapping of flow networks from digital elevation data
Terrain Analysis Using Digital Elevation Models (TauDEM)
Geography & Technology
Digital Elevation Model based Hydrologic Modeling
Terrain Analysis Using Digital Elevation Models (TauDEM)
Digital Elevation Models and Hydrology
Extending ArcGIS using programming
Introduction to ArcGIS Software
ArcGIS Pro: An Introduction Overview
Presentation transcript:

Extending ArcGIS via programming Why Programming Automation of repetitive tasks Implementation of functionality not available Programming functionality Scripts (AML, VB, Python, Avenue) Interfaces for application programmers Model Builder ArcObjects COM Integration

Three Views of GIS 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 derives new geographic data sets from existing data sets. adapted from www.esri.com

Examples TauDEM – ArcMap toolbar using Visual Basic/C++ (implementation of functionality not available in ArcGIS) Visual Basic Programming of simple grid calculations

TauDEM Software Functionality Pit removal (standard flooding approach) Flow directions and slope D8 (standard) D (Tarboton, 1997, WRR 33(2):309) Flat routing (Garbrecht and Martz, 1997, JOH 193:204) Drainage area (D8 and D) Network and watershed delineation Support area threshold/channel maintenance coefficient (Standard) Combined area-slope threshold (Montgomery and Dietrich, 1992, Science, 255:826) Local curvature based (using Peuker and Douglas, 1975, Comput. Graphics Image Proc. 4:375) Threshold/drainage density selection by stream drop analysis (Tarboton et al., 1991, Hyd. Proc. 5(1):81) Wetness index and distance to streams Water Quality Functions

TauDEM in ArcGIS Visual Basic ESRI ArcGIS 8.3, 9.0 Toolbar Standalone command line applications C++ COM DLL interface Available from TauDEM C++ library Fortran (legacy) components http://www.engineering.usu.edu/dtarb/ Shapelib TauDEM Gridio ESRI gridio API (Spatial analyst) Data formats Vector shape files ASCII text grid Binary direct access grid ESRI binary grid

Implementation Details Spatial Analyst includes a C programming API (Application Programming Interface) that allows you to read and write ESRI grid data sets directly. Excerpt from gioapi.h / * GetWindowCell - Get a cell within the window for a layer, * Client must interpret the type of the output 32 Bit Ptr * to be the type of the layer being read from. * * PutWindowCell - Put a cell within the window for a layer. * Client must ensure that the type of the input 32 Bit Ptr * is the type of the layer being read from. */ int GetWindowCell(int channel, int rescol, int resrow, CELLTYPE *cell); int PutWindowCell(int channel, int col, int row, CELLTYPE cell);

C++ COM Methods used to implement functionality using Microsoft Visual C++ STDMETHODIMP CtkTauDEM::Areadinf(BSTR angfile, BSTR scafile, long x, long y, int doall, BSTR wfile, int usew, int contcheck, long *result) { USES_CONVERSION; //needed to convert from BSTR to Char* or String *result = area( OLE2A(angfile), OLE2A(scafile), x,y,doall, OLE2A(wfile), usew, contcheck); return S_OK; }

Visual Basic for the GUI and ArcGIS linkage Private TarDEM As New tkTauDEM … Private Function runareadinf(Optional toadd As Boolean = False) As Boolean Dim i As Long runareadinf = False i = TarDEM.Areadinf(tdfiles.ang, tdfiles.sca, 0, 0, 1, "", 0, 1) If TDerror(i) Then Exit Function If toadd Then AddMap tdfiles.sca, 8 End If runareadinf = True End Function

Using TauDEM - Exercise

Calculating the distance to a drain point (e. g Calculating the distance to a drain point (e.g. watershed outlet or gage) Introduce VB scripting Introduce Recursion Isolate the Watershed draining to a point Could be done with the Flow Path function (maybe), but a programmed solution is instructive and can be generalized to other applications

Distance from each grid cell to outlet along flow path Write program to do this

Distances 30 42.4 42.4 42.4 30 30 30 42.4 42.4 42.4 30 30 30 30 42.4 42.4 42.4 30 30 30 30 42.4 30 30

Summing the distances down from each grid cell 30 30+42.4 72.4 30+30+42.4 102.4 30+30+42.4+30 132.4

Summing the distances down from each grid cell 30 30+42.4 30+30+42.4 30+30+42.4+30 Number of additions

Recursive Approach 30 30+42.4 72.4 30+72.4 102.4 30+102.4 132.4

Recursive Approach 30 30+42.4 30+72.4 30+102.4 Number of additions N

This requires (assumes) that the distance for cell i,j is initialized or has been calculated to start the process

Programming the calculation of distance to the outlet 5 1 8 7 6 3 2 4 5 6 7 Direction encoding 1 2 3 Distances to outlet 72.4 102.4 30 42.4 72.4

Visual Basic Implementation 'RECURSIVE DISTANCE CALCULATION FUNCTION Sub DistCalc(i, j) Dim k As Integer, inb As Long, jnb As Long For k = 1 To 8  ' for each neighbor     inb = i + di(k)     jnb = j + dj(k)     If (inb >= 0 And inb < nrow And jnb >= 0 And jnb < ncol) Then   ' guard ' against out of domain         If pPixels(jnb, inb) > 0 Then   ' guard against no data             If (pPixels(jnb, inb) - 4 = k Or pPixels(jnb, inb) + 4 = k) Then             ' Here we have a grid cell that drains back to the grid cell we are at                 dPixels(jnb, inb) = dPixels(j, i) + dd(k)                 DistCalc inb, jnb ' Call the function for the neighbor pixel             End If         End If     End If Next k End Sub

Steps for distance to outlet program Read the outlet coordinates Read the DEM flow direction grid. This is a set of integer values 1 to 8 indicating flow direction Initialize a distance to outlet grid with a no data value Convert outlet to row and column references Start from the outlet point. Set the distance to 0. Call the DistCalc function at the outlet.

Distance Calculation VBA Exercise

Visual Basic Programming in ArcMAP References ESRI, (1999), ArcObjects Developers Guide: ArcInfo 8, ESRI Press, Redlands, California. Zeiler, M., (2001), Exploring ArcObjects. Vol 1. Applications and Cartography. Vol 2. Geographic Data Management, ESRI, Redlands, CA.

Are there any questions ? AREA 1 AREA 2 3 12