ModelBuilder (included with ArcGIS Pro) provides a visual canvas to create geoprocessing models that automate GIS workflows. Invaluable for conducting sophisticated spatial analyses, models are everyday workhorses too. If built with reuse in mind, models can be your go-to shortcuts to get a lot of work done quickly.
In fact, you can think of ModelBuilder as a visual programming language and a model as a workflow map. Like a map:
If you've never created a model in ArcGIS, there's just one thing you need to know to get started: take a five-step approach:
1. Plan the Workflow
Obvious, but...before creating a model, know what you want it to do. List the data input, identify the required geoprocessing tools, and describe the desired output. If the workflow is simple, just think it through in your head.
For more complicated workflows, you may want to sketch everything out on paper or a whiteboard. If you're not sure which tool to use or what a tool's required inputs are, check the geoprocessing tool reference.
2. Create the Model Shell
In ArcGIS, a model is stored inside a toolbox. In ArcGIS Pro, when you create a new project, a toolbox with the same name as the project is automatically created.
Tip: You can also open a new model by right-clicking the toolbox folder in the Catalog pane and choosing New > Model.
Now set the model properties.
In the General tab, the option to “Store tool with relative path” should be selected. This is what you want, because using relative paths prevents headaches down the road if your data gets moved around.
Set the properties below, then click OK.
3. Add Tools and Set Parameters
With the basic setup done, now comes the fun part. You can't beat ModelBuilder for easy drag-and-drop building and tinkering. But hang on a sec, you need to understand some ModelBuilder vocabulary.
When you add a tool to a model (by dragging/dropping from the Catalog or Geoprocessing pane), its output element is also added and both elements are colored light gray. In model parlance, gray means "not ready to run." You need to double-click the tool and set its parameters.
Once you click OK to set the tool parameters, the input element displays and the process colorizes, Oz-like.
As you add processes, the model window may fill up. Use the Fit to Window and Auto Layout buttons to see the big-picture view and zoom in and out as needed.
Be sure to save periodically as you build the model (ModelBuilder tab > Save).
To add the final model process output as a layer to a map, right-click it and choose Add To Display. Otherwise, you'll have to manually add it to the map.
4. Validate the Model
After you've added all the tools and set their parameters, it's time to ensure the model will run properly. Validation is easy—just click the Validate button on the ModelBuilder tab.
During validation, if there's an error, processing will stop at the first process that requires a fix. Figure out what's wrong and make the fix, then validate again. Repeat if necessary, then save your work.
5. Run the Model
You have two basic options to run a model:
Running a model as a tool or service has distinct advantages for collaboration and sharing. We'll cover model tools in an upcoming post.
It's fun to run a model inside ModelBuilder. As the model progresses, each process turns red and then gets a drop shadow. The drop shadow indicates the process has completed correctly. If a process turns gray, that means an error needs to be fixed and the model stops running. If you've validated, this shouldn't happen.
(Optional) 6. Maybe Run It Again
A model's final output may raise a question. For example, suppose a model process created a 50-meter buffer around a feature. After examining the model output, you wonder what would result if you used a 100-meter buffer instead.
To find out, simply open the buffer tool, enter the new distance value, and run the model again starting at the buffer process (right-click the buffer tool and choose Run).
Because you're not altering preceding processes, you don't need to rerun the entire model. This is the beauty of a model. It's a perfect medium to explore and test what-if scenarios.
Like scripts, models are encapsulated workflows. Once built, they can be reused as a fast alternative to manually performing a set of individual processes. You can build a model to automate any geoprocessing task or series of tasks, from the complex to the straightforward.
Now that you've learned the steps to create a simple model, why not try it for yourself?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.