iterators in modelbuilder

10
Esri International User Conference | San Diego, CA Technical Workshops | Iterators in ModelBuilder Shitij Mehta 12 th July, 2011

Upload: wanly-pereira-arantes

Post on 02-Nov-2014

92 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Iterators in Modelbuilder

Esri International User Conference | San Diego, CATechnical Workshops |

Iterators in ModelBuilderShitij Mehta

12th July, 2011

Page 2: Iterators in Modelbuilder

Iteration = looping = repeat a process over and over

Iteration in ModelBuilder = Run entire model or asingle tool or processrepeatedly

Tools to iterate in ModelBuilder = Iterators

What is iteration?

Iterator

Page 3: Iterators in Modelbuilder

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 ContinueIterate

Feature Selection

Value

Selected Features

IterateRow

SelectionValue

Selected Rows

Iterate Field

ValuesValue Iterate

Multivalue Value

Iterate Datasets

Name

Dataset Iterate Feature Classes

Name

Feature Class Iterate

FilesName

File

Iterate Rasters

Name

RasterIterate Tables

Name

Table

Name

WorkspaceIterate Workspaces

Page 5: Iterators in Modelbuilder

Shitij Mehta

Demo 1 – Iterating Feature Classes

Page 6: Iterators in Modelbuilder

Shitij Mehta

Demo 3 – Model within a Model

Main Model

Sub-Model

Page 7: Iterators in Modelbuilder

Rules for a using iterators

• 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 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 variableC:\Scratch\scratch.gdb\output_%XYZ%

Page 8: Iterators in Modelbuilder

Shitij Mehta

Demo 3 – Iterating Feature Selection

Page 9: Iterators in Modelbuilder

Questions?

Page 10: Iterators in Modelbuilder

Thank You!!!!

Please fill out the online evaluation form.www.esri.com/sessionevals