forms a vital part of the work many companies do with a . Countless geoprocessing tasks may be performed on a daily basis. Some common geoprocessing tasks include:
- Converting (such as converting a shapefile to a geodatabase feature class)
- Overlaying data (by unioning or intersecting datasets)
- Extracting data (by clipping a subset of data or selecting data with certain characteristics)
- Finding what's nearby (by buffering data or finding points near other features)
- Managing data (by joining fields, copying datasets, or creating new datasets)
- Finding suitable locations or paths (by running ArcGIS Spatial Analyst tools, such as Weighted Overlay and Cost Path)
Within ArcGIS, there are different methods available for performing geoprocessing tasks. The method you choose depends on the method best suited to the particular task and your personal preference.
You can perform geoprocessing tasks by running a tool via its dialog box, at the command line, or within a script or a model.
A is a form on which you supply the parameter values for the tool, then click OK to run the tool. At the , you type the tool name and its parameter values, then press Enter to run the tool. Alternatively, you can create your own models inside, or add to, . Models you create may run a chain of tools in sequence, and scripts are useful for batch processing multiple inputs, such as when converting multiple datasets to a different format. Scripts can be written in any COM-compliant scripting language, such as Python, JScript, or VBScript, and they do not have to be added to toolboxes. They can be run directly from within the appropriate scripting application.
Learn more about toolboxes
Learn more about creating a model and adding a script to a toolbox
Learn more about using the command line
Learn more about building models
Learn more about tool licensing
For information on creating scripts, see
Writing Geoprocessing Scripts With ArcGIS.
About toolboxes
Toolboxes can contain and . Toolsets can also contain toolsets and tools. You can access toolboxes from the ArcToolbox window or the ArcCatalog tree. There is a collection of that you can use, or you can create your own toolboxes to store a collection of (tools installed with ArcGIS) or (models or scripts) that you have created. System tools are organized into toolsets, making it easier to find the tools you are looking for. By creating , you can easily organize your tools.
To view system toolboxes in the ArcCatalog tree, click Tools on the Main menu and click Options. Click the General tab and check Toolboxes in the list of top-level entries.
The collection of system toolboxes is added by default as shortcuts to your ArcToolbox window from the Toolboxes folder in your ArcCatalog tree. The ArcToolbox window provides a shortcut to the toolboxes you have stored in folders or on disk—those that can be seen in the ArcCatalog tree. It provides a way to centralize the location of toolboxes that might be spread out in different folders and geodatabases on your computer's disk. The ArcToolbox window can be docked to any ArcGIS Desktop application, such as ArcMap, ArcGlobe, or ArcCatalog.
Using dialog boxes and the command line
All tools (system tools or custom tools) can be run from a dialog box or from a command line.
When should you use a dialog box?
When should you use the command line?
- If you are familiar with the tool you want to use and the parameter values that need to be supplied, you may find the command line quicker and more convenient.
- You can create to replace more complex parameter values, such as a variable for the table that reclassifies a , to help you quickly perform your geoprocessing tasks.
Running tools via dialog boxes
Dialog boxes guide you through the process of running a tool by giving you a form where you specify the data and other necessary parameter values.
All tool dialog boxes have a Help panel that can be opened to display Help topics for the tool being used. A description of what the tool does and a definition of each parameter are just one click away. You can also click the Help button at the top of the Help panel to display more help for the tool including an illustration, a section explaining how the tool works, and examples of how to run the tool at the command line or within a script. Once you understand the tool and its parameters, you can close the Help panel to save space on your desktop.
View an illustration
Learn more about running a tool via its dialog box
Running tools at the command line
Regardless of the ArcGIS product (ArcInfo, ArcEditor, or ArcView) you have installed, you can access a command line in any ArcGIS Desktop application (such as ArcMap, ArcCatalog, or ArcScene). The command line is similar to the ArcInfo Workstation command line. You type a tool name, set appropriate parameter values, then execute the tool.
Tools can be run at the command line, provided that the toolbox containing the tool you want to run is added to the ArcToolbox window. After typing the tool name, the is displayed for the tool. It helps you supply values for the tool's parameters.
The command line honors the domain set for each parameter, so valid parameter values will be presented in a dropdown list. This includes any valid layers or keywords. It also allows for multiple commands to be run at one time. Simply type a command, then click and hold the Ctrl key and press Enter to type another command.
View an illustration
Learn more about using the command line to geoprocess your data
Building and running models
Building a model
For more complex geoprocessing tasks that involve multiple tools, you can create a new model by linking together in a graphical environment (a window). This enables you to create a visual diagram of the steps needed to complete a geoprocessing task. The diagram you build represents a model.
In the model diagram, components, or elements, reference input data, a tool that operates on the input data, and the resulting output data. Elements are connected together into processes. Connector arrows indicate the sequence of processing. You may have several processes in a model, and they can be chained together so the output data from one process becomes the input data for another process.
When should you build models?
- Models automate the process of performing a sequence of geoprocessing tasks on your data, so build models when you want to perform multiple geoprocessing tasks, such as clipping your data, unioning the results together, then selecting areas from the unioned results that meet a criteria.
- You can quickly change parameter values for tools in your model, then rerun the model to experiment with different outcomes.
- Build models when you need to present a to decision makers or the public.
Getting started
To open a ModelBuilder window, you first create a new model inside a toolbox or toolset. A ModelBuilder window opens automatically, so you can start building your model.
View an illustration
Building a model
To build a model, you can drag tools from toolboxes in the ArcToolbox window or the ArcCatalog tree and data from the ArcCatalog tree or the table of contents of any other ArcGIS Desktop application, such as ArcMap. Alternatively, use the Add Data and Tools button in the ModelBuilder window to add tools and data, which places their representative elements on the model diagram. When you fill in necessary parameter values for each tool and connect processes, your model will become ready to run.
Any parameter within the model can be set as a variable that can be shared between processes. This means you don't have to make updates to every tool that uses a particular parameter value; you can just update the value in one dialog box.
View an illustration
Running a model
When the model is run, the project data is processed in the order specified, and output data is created. You can save, modify, and rerun the model. It's easy to perform the procedure multiple times or alter data and other parameter values and rerun the model.
You can run the model from within the ModelBuilder window or from its dialog box. Variables in the model can be set as model parameters, so values for these parameters can be specified within your model's dialog box.
View an illustration
Running a script
In many instances, the work that must be done is repetitive. Whether it involves geoprocessing a large number of datasets or large datasets with numerous records, these geoprocessing tasks require automation. Any -compliant scripting language can be used to write scripts that execute ArcGIS geoprocessing tools, providing an efficient and effective way to automate your geoprocessing tasks.
When should you write a script?
- Scripts let you execute simple processes that include single tools, complex processes linked together, or looping to perform batch processing on a set of input datasets.
- Scripts are recyclable, meaning they can be data nonspecific and, therefore, used over and over again. They can increase efficiency because they can be executed at any time.
Writing a script
If you are new to scripting languages, you do not need to be an expert programmer to create and use scripts. You can build a model in a ModelBuilder window and export the model to a script that you can then run or modify.
View an illustration
The exported script for the model is shown in the illustration below.
View an illustration
By adding lines of code and wrapping the buffer process in a loop, all feature classes inside the specified workspace will be buffered.
View an illustration
Running a script
You can run a script as a standalone operation, or you can add a script to a toolbox and run the script from its dialog box. To do this you would add the script to a toolbox, then define the parameters, which you set as system arguments within the script, for which the user of the script must specify the values.
See
Writing Geoprocessing Scripts With ArcGIS for more information on writing scripts that will perform geoprocessing tasks.
Learn more about defining parameters for a script