Post on 13-Jun-2020
transcript
SERUG 2008SERUG 2008 11
ArcGIS Desktop: Introduction to Geoprocessing with ModelBuilder
Kevin ArmstrongKevin ArmstrongESRIESRI
SERUG 2008SERUG 2008 22
What is ModelBuilder?What is ModelBuilder?
•• A userA user--friendly way to automate a series of toolsfriendly way to automate a series of tools•• Part of the ArcGIS geoprocessing frameworkPart of the ArcGIS geoprocessing framework
•• ModelBuilder can run any tool in the ArcToolbox, ModelBuilder can run any tool in the ArcToolbox, including scripts, custom tools, and other modelsincluding scripts, custom tools, and other models
•• Supports GDBs, shapefiles, tables, coverages, rasters, Supports GDBs, shapefiles, tables, coverages, rasters, CADCAD
Geoprocessing and GISGeoprocessing and GIS
SERUG 2008SERUG 2008 33
““Computing with dataComputing with data””geoprocessinggeoprocessing
Data visualizationData visualizationand explorationand exploration
Data compilation, editing,Data compilation, editing,and maintenanceand maintenance
SERUG 2008SERUG 2008 44
Tools and FrameworkTools and Framework
ToolsToolsPerforms essential and elementalPerforms essential and elementalOperations on GIS data.Operations on GIS data.
Learning the tools enables you toLearning the tools enables you toSolve realSolve real--world problems.world problems.
The mechanics of using, managing, andThe mechanics of using, managing, andPublishing tools.Publishing tools.
Automating workflows by creating newAutomating workflows by creating newToolsTools -- models and scripts.models and scripts.
FrameworkFramework
Framework: Four ways to use toolsFramework: Four ways to use tools
SERUG 2008SERUG 2008 55
ModelsModels
Command LineCommand Line
Tool dialogTool dialog
ScriptsScripts
Demo 1Demo 1
•• Create a new toolbox, add new tools/modelCreate a new toolbox, add new tools/model•• Build a modelBuild a model•• Run the model w/in ModelBuilderRun the model w/in ModelBuilder•• Add more processes and run themAdd more processes and run them
SERUG 2008SERUG 2008 66
ArcToolbox BasicsArcToolbox Basics•• Dockable window in any ArcGIS Dockable window in any ArcGIS
applicationapplication
•• System tools organized into System tools organized into toolboxes and toolsetstoolboxes and toolsets
•• Each toolbox contains tools with Each toolbox contains tools with similar functionality. Toolsets similar functionality. Toolsets refine further.refine further.
•• Window has four tabsWindow has four tabs•• FavoritesFavorites –– treetree--view of all toolsview of all tools•• Index and Search Index and Search -- assist in assist in
finding toolsfinding tools•• ResultsResults –– logs what youlogs what you’’ve done ve done
and helps manage tool resultsand helps manage tool resultsSERUG 2008SERUG 2008 77
Show/HideShow/HideArcToolbox WindowArcToolbox Window
Demo Review: Model elementsDemo Review: Model elements
ToolsTools•• Drag and drop into windowDrag and drop into window•• Use Add buttonUse Add button
DataData•• Drag and drop into windowDrag and drop into window•• Drag and drop onto toolsDrag and drop onto tools•• Fill in dialogFill in dialog•• In ArcMap, from the TOCIn ArcMap, from the TOC•• Use Add buttonUse Add button
SERUG 2008SERUG 2008 88
Elements can be:Elements can be:
•• Copied/pastedCopied/pasted within the same model, and other within the same model, and other modelsmodels
•• DeletedDeleted -- remaining elements become remaining elements become ““not ready to not ready to runrun””
•• RenamedRenamed -- only changes the label not the nameonly changes the label not the name•• DisconnectedDisconnected from a tool (exception: derived data from a tool (exception: derived data
variables)variables)
SERUG 2008SERUG 2008 99
Demo Review:Demo Review:Model Process and process statesModel Process and process states
SERUG 2008SERUG 2008 1010
Add FieldLand CoverTable (2)
Land CoverTable
Demo Review: Derived dataDemo Review: Derived data
SERUG 2008SERUG 2008 1111
Project Data Project Data ––data you provide data you provide
to the modelto the model
Derived Data Derived Data ––data created by data created by
tools in the modeltools in the model
In/Out Derived In/Out Derived DataData –– input data input data updated by toolupdated by tool
Demo Review: Demo Review: Connecting data and processesConnecting data and processes
•• There are two ways you can connect data elements to tool There are two ways you can connect data elements to tool elements, either by using the Connect tool or the tool'elements, either by using the Connect tool or the tool'ssdialogdialog
•• To connect processes, connect the output of one process to the To connect processes, connect the output of one process to the input of anotherinput of another
SERUG 2008SERUG 2008 1212
Demo Review: Demo Review: Execution messagesExecution messages
Status messages can be viewed in: Status messages can be viewed in: •• Progress dialog and Command Line window (if opened)Progress dialog and Command Line window (if opened)•• RightRight--click on process and View Messagesclick on process and View Messages•• ReportsReports
For each model, it shows:For each model, it shows:•• The parameter values specifiedThe parameter values specified•• The time the tool was runThe time the tool was run•• The status of the executionThe status of the execution•• The time the tool finished executingThe time the tool finished executing•• Execution errors messagesExecution errors messages
SERUG 2008SERUG 2008 1313
Demo 2Demo 2
•• Run the model from ArcToolboxRun the model from ArcToolbox•• Create and use parametersCreate and use parameters•• Changing model propertiesChanging model properties
SERUG 2008SERUG 2008 1414
Running a model: From a dialog boxRunning a model: From a dialog box•• DoubleDouble--click on the model from ArcToolboxclick on the model from ArcToolbox
SERUG 2008SERUG 2008 1515
•• If there are no model parameters, If there are no model parameters, just click OK in the dialogjust click OK in the dialog
•• If there are model If there are model parameters, populate what parameters, populate what is required, then click OK is required, then click OK to run the modelto run the model
Demo Review:Model parameters
SERUG 2008SERUG 2008 1616
P
P
P
Element name becomesParameter label in dialog box
Model parameters willHave a “P” next to them
Demo Review: Demo Review: Adding ResultsAdding Results
Tools > Options > Geoprocessing tab > Add resultsTools > Options > Geoprocessing tab > Add results……•• All OUTPUT parameters will be added to mapAll OUTPUT parameters will be added to map
SERUG 2008SERUG 2008 1717
Making variablesMaking variables•• ModelBuilder will create a variable for all input datasetsModelBuilder will create a variable for all input datasets
–– You decide which tool arguments to expose as variablesYou decide which tool arguments to expose as variables–– Any variable can be made a model parameterAny variable can be made a model parameter
•• RightRight--click tool: Make Variable > From Parameter click tool: Make Variable > From Parameter –– Then set variable as a model parameterThen set variable as a model parameter
SERUG 2008SERUG 2008 1818
Intermediate dataIntermediate data
•• You decide to how to You decide to how to handle intermediate datahandle intermediate data
•• Data marked as Data marked as intermediate:intermediate:
SERUG 2008SERUG 2008 1919
–– Is deleted after model run as a Is deleted after model run as a dialog from ArcToolboxdialog from ArcToolbox
–– Is flagged but NOT deleted Is flagged but NOT deleted automatically if model is run automatically if model is run from ModelBuilder windowfrom ModelBuilder window
Model properties dialogModel properties dialog
•• Choose Model Properties on the tools Choose Model Properties on the tools context menu, context menu, oror
SERUG 2008SERUG 2008 2020
•• In the MB window:In the MB window:Model menu > Model Model menu > Model PropertiesProperties
Model properties: GeneralModel properties: General
•• Modify the name, label, Modify the name, label, description, and style description, and style sheetsheet
•• Specify relative vs. Specify relative vs. absolute pathsabsolute paths
SERUG 2008SERUG 2008 2121
Model properties: ParametersModel properties: Parameters
•• Add, remove, or change the order of exposed Add, remove, or change the order of exposed parametersparameters
SERUG 2008SERUG 2008 2222
Demo 3Demo 3
•• Add Feature Set inputAdd Feature Set input•• Prepare model for sharingPrepare model for sharing•• Some conceptsSome concepts
–– A generic model tool is one where all data is A generic model tool is one where all data is supplied by user supplied by user –– just like a system tool. just like a system tool.
–– If your model contains references to data (on your If your model contains references to data (on your local disk or Local Area Network), your tool must local disk or Local Area Network), your tool must have access to the data in order to run.have access to the data in order to run.
–– Default values should make sense to the user. Default values should make sense to the user.
SERUG 2008SERUG 2008 2323
Feature sets and record setsFeature sets and record sets
•• Interactive input of featuresInteractive input of features–– Example: Allow the user to click a point on the Example: Allow the user to click a point on the
map to buffer rather than using a point feature map to buffer rather than using a point feature class as an inputclass as an input
•• StoredStored ““in memoryin memory””•• Schema taken from existing data or layerSchema taken from existing data or layer
–– Feature typeFeature type–– FieldsFields–– Must have a schemaMust have a schema
SERUG 2008SERUG 2008 2424
Sharing tools: Sharing tools: How data is used in the toolHow data is used in the tool
•• All variables have values. Can be run w/in ModelBuilder (all All variables have values. Can be run w/in ModelBuilder (all processes readyprocesses ready--toto--run). All data accessible.run). All data accessible.
•• Data conversion tool that expects a certain file format and alwaData conversion tool that expects a certain file format and alwaysyswrites to same location.writes to same location.
SERUG 2008SERUG 2008 2525
•• Some data variables have values. The data is accessible. Cannot Some data variables have values. The data is accessible. Cannot beberun within ModelBuilder (some processes notrun within ModelBuilder (some processes not--readyready--toto--run)run)
•• User enters an address, a fiveUser enters an address, a five--mile buffer around address created mile buffer around address created and used to clip known data.and used to clip known data.
•• Completely generic Completely generic –– no data variables have values. Cannot be run no data variables have values. Cannot be run within ModelBuilderwithin ModelBuilder
•• Like a system tool that takes any dataset.Like a system tool that takes any dataset.
SERUG 2008SERUG 2008 2626
SERUG 2008SERUG 2008 2727
Final ModelFinal Model
New at 9.3New at 9.3•• Start ModelBuilder button on Start ModelBuilder button on
Standard Toolbar in DesktopStandard Toolbar in Desktop
•• Improved Error MessagesImproved Error Messages
•• Results ManagementResults Management
•• Progress BarProgress Bar
SERUG 2008SERUG 2008 2828
ModelBuilderModelBuilder SupportSupportOnlineOnline
http://http://support.esri.com/geoprocessingsupport.esri.com/geoprocessinghttp://http://arcscripts.esri.comarcscripts.esri.com
ArcGISArcGIS Desktop online helpDesktop online help
Virtual CampusVirtual CampusGeoprocessingGeoprocessing usingusing ModelBuilderModelBuilder (free)(free)GeoprocessingGeoprocessing CAD data with CAD data with ArcGISArcGIS (free)(free)
Author & Publishing Author & Publishing GeoprocessingGeoprocessing Services (free)Services (free)LearningLearning ArcGISArcGIS Desktop (8 modules Desktop (8 modules -- $175)$175)
GeoprocessingGeoprocessing with with ArcGISArcGIS Desktop (5 modules Desktop (5 modules -- $100)$100)Intro to Urban & Regional Planning (6 modules Intro to Urban & Regional Planning (6 modules -- $125)$125)
InstructorInstructor--LedLedIntroduction to Introduction to ArcGISArcGIS II (3 days II (3 days -- $1425)$1425)
Advanced Analysis with Advanced Analysis with ArcGISArcGIS (3 days (3 days -- $1425)$1425)Writing Advanced GP Scripts with Python (3 days Writing Advanced GP Scripts with Python (3 days -- $1425$1425
SERUG 2008SERUG 2008 2929