Automatisation of the grid production Ola Nordbeck

1
How to automatise the grid production
- using model builder in ArcGIS
Ola Nordbeck
Statistics Norway
Objectives
• Basics
• Model benefits
• Document a model and its components
• Parameterize the tools
• Other tips
• Demo and exercise
2
Basics
• Models are a series of geoprocessing tools that facilitate the
automation of complex or repetitive tasks
• Model Builder is a graphical interface that allows users to
easily create models using existing tools and data
• Requires no programming experience
3
Basics – creating a model
Any tool, script or data can be included in the model by
dragging and dropping
4
Basic – Model elements
Tools
Data
• Drag and drop into window • Drag and drop into
window
• Use Add button
• Drag and drop onto tools
• Fill in dialog
• In ArcMap, from the TOC
• Use Add button
5
Basics – work flow
Derived data from one tool may be used as input to one or
more other tools
6
Basic - Run States
Not ready to run –
input is set, tool
parameters are not
Ready to run
Already Run (tool and
output are shadowed)
7
Model Benefits
• Models provide an easy way to interpret visual
representation of the data and workflow
• Models can be reused and shared, and are easy to modify if
necessary
• Models are much more convenient than running many tools
individually
• Models can be useful in project documentation
8
Documentation
• Documentation for a model can be viewed in the model
dialog box, ArcCatalog, or Desktop Help
• On the model context menu
in ArcCatalog, choose Item
Description…, then click the
Edit icon to add information
• Basic documentation (name,
label and description) can
also be added on the model
properties dialog
9
Parameters
• Any information used by a tool is a parameter
• Parameters can be hardcoded or set so a user can enter
values
• For example, it is often a good idea to set tool inputs as
parameters to make models more flexible
• It is also useful to make variables for some tool inputs and
expose them as parameters for user input (example coming
up)
10
Parameters
• All tool parameters can be set using the Open… option on
the tool’s context menu
11
Example
Variables
Shaded variables have hardcoded values
12
Model Dialog with no Parameters or
Documentation
• Some models have no parameters
13
Example with Parameters
Variables with a “P” are now parameters
• Variable names are more meaningful
14
Model Dialog with Parameters and
Documentation
• Parameters are
listed in the order
they were added
to the model
• Order can be
changed in the
model properties
15
Tips
• Working in the model builder application vs. using the model
as a tool
– Keep vs. delete intermediate data
– Run vs. Run Entire Model
• Iteration – added from Insert menu or set in the model
properties
• Add to Display
• Export to script
16
Demo and exercise
Go through the tools used in the exercise:
“Production of gridded population statistics”
17