Technical Workshops | Esri International User Conference San Diego, California Branching and Iteration in ModelBuilder Shitij Mehta July 24, 2012 3:15.

Slides:



Advertisements
Similar presentations
WITHOUT LANGUAGE [ DEVELOPING GEO-PROCESSING MODELS USING ARCGIS MODELBUILDER 10 ] PROGRAMMING R. RYAN STEVENS / GIS RESEARCH ANALYST / THE POLIS CENTER.
Advertisements

Publishing GIS Services to ArcGIS for Server
Why python? Automate processes Batch programming Faster Open source Easy recognition of errors Good for data management What is python? Scripting programming.
Esri International User Conference | San Diego, CA Demo Theater | Tips and Tricks for Troubleshooting ArcGIS Desktop 10 Todd Stuber, Chris Fox July 12,
Esri UC 2014 | Technical Workshop | Automating Cache Workflows and Tile Usage Heat Maps Eric J. Rodenberg.
Geography 465 Overview Geoprocessing in ArcGIS. MODELING Geoprocessing as modeling.
Technical Workshops | Esri International User Conference San Diego, California Customizing ArcPad solutions Marika Vertzonis, Gareth Walters, Stephen Quan.
Geocoding - Advanced Techniques
Esri International User Conference | San Diego, CA Technical Workshops | Xuguang Wang Kevin M. Johnston ****************** Performing Image Classification.
Esri International User Conference | San Diego, CA Technical Workshops | Intro to ArcSDE for SQL Server Tony Wakim & Jim Gough July , 2011.
Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions.
Esri International User Conference | San Diego, CA Technical Workshops | Managing and Editing Annotation Natalie Vines Samantha Keehan July 14, 2011.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Editing in ArcMap:
ArcGIS Workflow Manager An Introduction
Esri International User Conference | San Diego, CA Technical Workshops | Loading CAD data into the Geodatabase Alex LeReaux Thursday, July 14, 2011 – 10:15.
Technical Workshops | Esri International User Conference San Diego, California ArcMap: Tips and Tricks Miriam Schmidts Jorge Ruiz-Valdepena July 23 – 27,
Esri International User Conference | San Diego, CA Technical Workshops | Python – Getting Started Drew Flater, Ghislain Prince July 12 - July 14, 2011.
Working with cursors in Python GISDE Python Workshop Qiao Li.
Esri UC 2014 | Technical Workshop | Accessing Spatial Databases in ArcGIS using Query Layers Annie Sasidar.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Generalization for.
Network Analysis with Python
Python: An Introduction
ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California ModelBuilder – Getting.
ArcGIS Workflow Manager: Tasks and Enterprise Workflows Michael Broadbent.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Caching Imagery Using.
Data Interoperability Basics Bruce Harold & Dale Lutz.
Enabling High-Quality Printing in Web Applications
Working with Metadata in ArcGIS Aleta Vienneau. Working with metadata in ArcGIS View metadata Edit metadata Set your metadata style Leverage metadata.
Esri Defense Mapping: Cartographic Production
Technical Workshops | Esri International User Conference San Diego, California Creating Geoprocessing Services Kevin Hibma, Scott Murray July 25, 2012.
Esri UC 2014 | Technical Workshop | Python Map Automation – Beyond the Basics of arcpy.mapping Jeff Barrette Jeff Moulds.
Navigator for ArcGIS – Tech Preview Mark Bockenhauer Scott Sandusky.
Esri UC 2014 | Demo Theater | ArcGIS Workflow Manager: Integrating Geoprocessing into Your Business Processes Nishi Mishra.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Geodatabase Administration:
Esri UC 2014 | Technical Workshop | Geocoding with ArcGIS Online and ArcGIS Online World Geocoding Service Jeff Rogers and Brad Niemand.
Network Analyst in ArcGIS Pro Scott Sandusky. Network Analyst in ArcGIS Pro This session covers how to use Network Analyst in ArcGIS Pro. It will also.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Geocoding – An Introduction.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Supporting High-Quality.
ArcGIS Workflow Manager: Getting Started with Out-of-the-Box Templates Michael Broadbent.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Building Map Books.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Automating Geodatabase.
Esri UC 2014 | Technical Workshop | Data Interoperability: An Introduction Bruce Dale LutzSafe Software.
Esri UC 2014 | Technical Workshop | Creating Geoprocessing Services Kevin Hibma.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Customizing the Operations.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Migrating Parcel data.
Migrating Data into the Parcel Fabric in ArcMap
Collector for ArcGIS: Tips and Tricks Morgan Zhang Li Lin.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Concepts and Applications.
Esri UC 2014 | Technical Workshop | Python: Beyond the Basics David Wynne, Jon Bodamer.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Python – Raster Analysis.
Esri UC 2014 | Technical Workshop | Editing in ArcMap: An Introduction Lisa Stanners, Phil Sanchez.
Python: Building Geoprocessing Tools David Wynne, Ghislain Prince.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Working with Metadata.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Working with Cartographic.
Esri UC 2014 | Technical Workshop | Migrating Data To The Parcel Fabric Christine Leslie Amir Bar-Maor.
Tech Support Tips and Tricks: ArcGIS for Desktop
ArcGIS Workflow Manager: Advanced Workflows and Concepts
PYTHON: AN INTRODUCTION
Geoprocessing with ArcGIS for Server
Python Map Automation – Beyond the Basics of arcpy.mapping
ArcGIS Workflow Manager: Using Custom Properties to Automate Workflows
Network Analysis using Python
ModelBuilder – Getting Started
PYTHON: BUILDING GEOPROCESSING TOOLS
Network Analyst – Automating Workflows with Geoprocessing
Python – Beyond the Basics
ModelBuilder – Getting Started
Geocoding with ArcGIS Desktop: An Introduction
Presentation transcript:

Technical Workshops | Esri International User Conference San Diego, California Branching and Iteration in ModelBuilder Shitij Mehta July 24, :15 pm - 4:30 pm

Questions for you How many User Conferences have you been to? Geoprocessing experience? - Little (rarely used) - Some (know the basics) - Advanced (build your own tools) - Guru (anointed or legendary?) Platform?

Outline - I apologize - there is a lot to cover Branching – 30 minutes - Calculate Value - Demo 1 - Tool – Feature Type - Demo 2 – Shape Type - Demo 3 – Merge Branch - Demo 4 - Script tool example Iteration – 30 minutes - Demo 1- Iterate Feature Classes - Demo 2 – Iterate For - Demo 3 – Iterate Feature Selection - Demo 4 – Iterate Multivalue - Demo 5 – 2 Level Nested Model - Demo 6- 3 Level Nested Model - Python Equivalent of Iterators in ModelBuilder

All presentations will be available online!!!!!!!

What is Branching? IF some condition is true, THEN perform an action; ELSE the condition is false, perform a different action. File in Workspace File in Workspace If file X exists Add a field Else if file X does not exists Copy and then add a field Else if file X does not exists Copy and then add a field Feature Class If has X projection Do nothing If has X projection Do nothing Else - Project Examples

How to branch? The condition - If-then-else 1 Calculate Value tool 1 Calculate Value tool 2 Script tool 2 Script tool Where to find the tool Python Code Data types Preconditions in a model Inline Variable Substitution Merge Branch tool Creating a script tool Python code Setting script tool properties Preconditions in a model Merge Branch tool OR

Inline Variable Substitution The value of any variable can be used in the tool parameters by enclosing the name of the substituting variable between the percent signs (%). Substituting variables in this manner is called inline variable substitution.inline variable substitution

Inline variable substitution In SQL expressions - Name = ‘%Value%’ - “%Value%”.replace( “ ”, “”) In Output name – C:\Scratch\Scratch.gdb\%Value% If string put “quotes” around your inline variable substitution

Precondition Preconditions can be used to explicitly control the order of operations in a model. Any variable can be made a precondition to tool execution, and any tool can have more than one precondition.

Demo 1 Branching using the Calculate Value tool

Demo 2 Branching using a Script tool

Where to get help? Click Doc, BlogsDoc 1.Understanding which if troubles youUnderstanding which if troubles you 2.If you are stuck at "if" – Part 1 – Branching using the Calculate Value toolIf you are stuck at "if" – Part 1 – Branching using the Calculate Value tool 3.If you are stuck at "if" – Part 2 – Example of using Script tool to create branches using if-else logicIf you are stuck at "if" – Part 2 – Example of using Script tool to create branches using if-else logic 4.If you are stuck at "if" – Part 3 – Does Extension Exists model exampleIf you are stuck at "if" – Part 3 – Does Extension Exists model example 5.If you are stuck at "if" – Part 4 – Does Selection Exists model exampleIf you are stuck at "if" – Part 4 – Does Selection Exists model example 6.If you are stuck at "if" – Part 5- Does Projection Exist model exampleIf you are stuck at "if" – Part 5- Does Projection Exist model example

Iteration

Iteration = looping = repeat a process over and over Iteration in ModelBuilder = Run entire model or a single tool or a set of tools repeatedly Tools to iterate in ModelBuilder = Iterators Example - Iterate over a list of feature classes and project each feature class. What is iteration? Iterator

Iterates over a starting and ending value by a given value. Iterates "while" a condition is true or false. Iterates over features in a feature class. Iterates over rows in a table.Iterates over each value in a field. Iterates over a list of values. Iterates over datasets in a Workspace or Feature Dataset. Iterates over feature classes in a Workspace or Feature Dataset. Iterates over files in a folder. Iterates over rasters in a Workspace or a Raster Catalog. Iterates over tables in a workspace. Iterates over workspaces in a folder. For Value While Continue Iterate Feature Selection Iterate Feature Selection Value Selected Features Selected Features Iterate Row Selection Iterate Row Selection Value Selected Rows Selected Rows Iterate Field Values Iterate Field Values Value Iterate Multivalue Iterate Multivalue Value Iterate Datasets Iterate Datasets Name Dataset Iterate Feature Classes Iterate Feature Classes Name Feature Class Feature Class Iterate Files Iterate Files Name File Iterate Rasters Iterate Rasters Name Raster Iterate Tables Iterate Tables Name Table Name Workspace Iterate Workspaces

Accessing the iterators in ModelBuilder

Demo 1 Iterating Feature Classes

Demo 2 Iterating For

Demo 3 Iterating Feature Selection

Demo 4 Iterating Multivalue

Demo 5 Model within a Model Main Model Sub-Model

Demo 6 Model within a Model within a Model 3 Level Nested Models Model 1 Model 3 Model 2

Rules for a nested model/model within a model Only one iterator can be used per model. Add only the tools you want to run as many times as an iterator in the same model. The script will not include the iteration logic if a model with an iterator is exported to a Python script. The output of any tool connected to the iterator can have (if required) a unique name for each iteration to avoid being overwritten by Using the system variable %n% C:\Sctatch\scratch.gdb\output_%n% Using the Name or Value output of the iterator C:\Sctatch\scratch.gdb\output_%Name% C:\Sctatch\scratch.gdb\output_%Value% Using any other variable in the model as an inline variable C:\Scratch\scratch.gdb\output_%XYZ%

Rules for a nested model/model within a model Give default values to your sub model for setting and testing it Make model parameters in your sub-model that you want as variable in main model

Python Equivalent of Iterators in ModelBuilder

Where to get help? Click Doc, Tutorials, BookDocTutorialsBook

Questions? Please fill out the evaluation form online at: Session ID

24 th July - Tuesday 1:30PM 2:45PM Technical Workshop Analysis and Geoprocessing ModelBuilder - Getting StartedBall06 B 3:15PM 4:30PM Technical Workshop Analysis and Geoprocessing Iteration and Branching in ModelBuilder Ball06 B 25 th July - Wednesday 8:30AM 9:45AM Technical Workshop Analysis and Geoprocessing Geoprocessing with ArcGIS for Server04 8:30AM 9:45AM Technical Workshop Analysis and Geoprocessing Network Analyst—Automating Workflows with Geoprocessing 10 10:15AM 11:30AM Technical Workshop Analysis and Geoprocessing Building Tools with ModelBuilderBall06 D 1:30PM 2:45PM Technical Workshop Analysis and Geoprocessing Building Tools with Python28 E 1:30PM 2:45PM Technical Workshop Analysis and Geoprocessing ModelBuilder - Getting StartedBall06 B 2:00PM 3:00PM Demo Theater Presentation Analysis and Geoprocessing ModelBuilder Tips and Tricks Demo Theater - Analysis and Geoprocessing Exhibit Hall B 26 th July - Thursday 8:30AM 9:45AM Technical Workshop Analysis and Geoprocessing Geoprocessing with ArcGIS for Server09 10:15AM 11:30AM Technical Workshop Analysis and Geoprocessing Building Tools with Python09 1:30PM 2:45PM Moderated Paper Session Analysis and Geoprocessing Building Applications Using ModelBuilder and Python Scripting 27 A 3:15PM 4:30PM Technical Workshop Analysis and Geoprocessing Building Tools with ModelBuilderBall06 D

Thank You!!!!