advance model builder features. advance features using lists (also batching) iteration feedback...

21
Advance Model Builder Features

Upload: victor-dixon

Post on 24-Dec-2015

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions

Advance Model Builder Features

Page 2: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions

Advance Features

• Using Lists (also Batching)• Iteration• Feedback• Model Only Tools• Inline Variable Substitution• Preconditions• Feature Set and Record Set• If-then-else logic• In-memory workspace• Integration of model, scripts and external programs

Page 3: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions

Using Lists• A variable that contains one or more values is called a list

variable. It is a property of a variable • When an output list variable is created in a model, you can use

%i% as in-line variable substitution in the output name. %i% appends the list number at the end of output name.

Page 4: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions

Using Lists

• The model is now ready to run from within ModelBuilder. The model will execute for each input contained in the Input Feature Class list variable.

Page 5: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions

Using Lists

• It is my opinion that Lists are best used from multi-step, but “short” processing.

• Use the %i% to create unique output for each list “input”. %i% starts at zero (%0%)

Page 6: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions

Batch Processing

• In ArcGIS batch processing means to execute a single tool multiple times with different inputs without your intervention.

• In ArcCatalog or ArcToolbox, right-click a tool and click Batch. This will open the batch window, where you can set up multiple runs for the tool. When you open the batch window for a tool, one row is automatically added, ready to accept input. The following example uses the Clip tool.

Page 7: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions

Batch Processing

• Entering parameters: To enter the parameters for an entire row, double-click the row header to open the tool's dialog, as shown below. Alternatively, you can right-click the row header and click Open. Use the dialog to enter one or more of the parameter values.

Click OK

Page 8: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions

Iteration

• Iteration or Looping, is to repeat a process over and over with some degree of automation.

• There are 12 iteration tools in Model Builder.– For: For iterates over a starting and ending value

by a given value. It works exactly like For in any scripting/programming language, executing through a set number of items.

– While: While works exactly like 'while' in any scripting/programming language, executing "while" a condition is true.

Page 9: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions

Iteration

– Iterate Feature Selection: Iterate Feature Selection tool iterates over features in a feature class.

– Iterate Row Selection: Iterate Row Selection tool iterates on rows in a table.

– Iterate Field Values: Iterate Field Values tool iterates over each value in a field.

– Iterate Multivalue: Iterate Multivalue tool takes a user-specified list of inputs (for example, inputs from different locations or a subset from a single location of any single type) and runs the model for each value.

Page 10: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions

Iteration– Iterate Datasets: Iterates over datasets in a Workspace

or Feature Dataset.– Iterate Feature Classes: Iterate Feature Classes tool

iterates over feature classes in a workspace or feature Dataset.

– Iterate Files: Iterate Files tool iterates files in a folder. – Iterate Rasters: Iterate Rasters tool iterates over rasters

in a Workspace or a Raster Catalog.– Iterate Tables: Iterate Tables tool iterates over tables in

a workspace.– Iterate Workspaces Iterates over workspaces in a

folder.

Page 11: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions

Iteration

• Only one iterator can be used per model.• If an iterator is added to a model, all tools in the

model iterate for each value in the iterator.• If a model containing an iterator is exported to a

Python script, the script will not include the iteration logic.

• Using an iterator will set a default value of -1 in Iteration Options in Model Properties, which simply means that the model will run for unlimited times or based on the number of inputs in an iterator, and not on a set number.

Page 12: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions

For

• Iterates over a starting and ending value by a given value. It works exactly like For in any scripting/ programming language, executing through a set number of items.

• Buffer Example

Page 13: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions
Page 14: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions

Buffer around Hospitals

Basic Model

Page 15: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions

Buffer around Hospitals

Add the For Iterator

Connect the output Value from the For Iterator to the Buffer tool. You most define the Buff input for the Value .

Page 16: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions

Buffer around HospitalsDefine the iteration valuesIn the For iterator

Use “Value” as an in-line variable substitution to create a unique output

Hosp_buff%Value%

Page 17: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions

Buffer around Hospitals

Page 18: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions

Feedback• In ModelBuilder, the output of a process can be used as an

input to a previous process. This is known as feedback, since an output is fed back to a previous process as input.

Page 19: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions

Feedback

Define number of iterations using the For iterator.

Page 20: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions

Feedback

• A feedback variable can be defined from a variable properties or using the connect tool.

• %n% can be used to insert a systems variable corresponding to the iteration number.

Page 21: Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions

Feedback