A quick tour of geoprocessing
Tools and toolboxes
Geoprocessing tools perform small yet essential operations on geographic data, such as extracting and overlaying data; changing map projections; adding a column to a table; and calculating attribute values, polygon overlays, and optimal routes, to name a few. There are hundreds of tools at your disposal, and you can create your own tools using ModelBuilder, a visual programming language, or scripting, a text-based programming language.
Tools are stored in toolboxes. ArcGIS ships with hundreds of tools organized into a dozen or so toolboxes, providing a rich set of functionality across a wide range of disciplines.
To execute a tool, you must first find it. There are four ways to find a tool:
- A handful of commonly used tools can be found in the Geoprocessing menu found on the Standard toolbar. You can customize this list using Customize > Customize mode.
- Search for a tool in the Search window . Search allows you to enter keywords, short phrases that describe what the tool does.
- Browse for a tool in the Catalog window . Browse requires you know which toolbox contains the tool.
- Browse for a tool in the ArcToolbox window . The ArcToolbox window, like the Catalog window, displays toolboxes and tools as a tree view. You can add your custom toolboxes to the ArcToolbox window.
Learn more about finding tools
Tool dialog box
To open the tool's dialog box from the Search window, click the tool name. To open the tool's dialog box in the Catalog window, double-click the tool or right-click the tool and click Open.
After you enter the tool's parameters in the dialog box, click OK to execute the tool. In this example, the Clip tool clips features from the Streets layer. The output feature class, Streets_Clip3, will contain only those features that fall within the StudyArea polygons. The output feature class will be automatically added to the ArcMap table of contents.
Learn more about executing toolsBackground processing and the Results window
Tools execute in the background, meaning you can continue working with ArcMap (or other applications, such as ArcGlobe) while the tool executes. You'll see a progress bar at the bottom of your document displaying the name of the currently executing tool. When the tool finishes executing, a pop-up notification will appear on the system tray.
Learn more about background processing
You can keep track of tool execution in the Results window. To open the Results window, click Geoprocessing > Results. Using the Results window, you can find out everything about the execution of a tool.
Models and ModelBuilder
Geoprocessing allows you to chain together a sequence of tools, feeding the output of one tool into another. You use a geoprocessing model to chain tools together, and ModelBuilder, shown below, is how you create models.
You can open the ModelBuilder window with the Start ModelBuilder button or by clicking Geoprocessing > ModelBuilder. The above model was constructed by creating a new empty model and dragging and dropping tools from the Search or Catalog window into the ModelBuilder window.
The most important thing to note here is that models are tools. They behave exactly like all other geoprocessing tools. You can execute them using their dialog box or in scripts. Since models are tools, you can embed models within models.
Python and scripting
Python is a free, cross-platform, open-source programming language that is fast, powerful, and easy to learn. Python is considered a scripting (or interpretive) language, since it does not require a compiler. Programs that you write with Python are called scripts. There are other scripting languages besides Python, but ESRI has chosen Python as its preferred scripting language because of its power and wide acceptance.
Python is automatically installed when you install ArcGIS. All geoprocessing tools, as well as a wide variety of useful functions for interrogating GIS data, are available in the ArcPy site-package. A site-package is Python's term for a library that adds additional functions to Python, and the ArcPy site-package is how GIS functions are added to Python. The ArcPy site-package is installed with ArcGIS. Using Python and the ArcPy site-package, you can develop an infinite number of useful programs that operate on geographic data.
There are three basic ways you can run Python code in ArcGIS:
- You can execute Python code interactively in the Python window, opened with the Python window button or by clicking Geoprocessing > Python. The Python window is an interactive window that lets you enter Python code, execute it immediately, and view the results in your active map.
- You can execute a Python script (a file with the .py extension) from the operating system prompt. Since you execute the script from the operating system prompt, you do not have to have an ArcGIS application running (such as ArcMap). Scripts that are executed from the operating system prompt are referred to as stand-alone scripts.
- You can create your own geoprocessing tool that executes a Python script. A tool that executes a script is called a script tool, and you can use a script tool like any other geoprocessing tool, embedding it in models or using it in other scripts. Script tools are not limited to Python scripts—you can create a script tool that executes anything, such as a JavaScript, AML, .bat, or .exe.