A geoprocessing package is a convenient way to share geoprocessing workflows by packaging one or more tools and the data used by the tools into a single compressed file (.gpk). All resources (models, scripts, data, layers, and files) needed to reexecute the tools are included in the package. This means consumers of your package can rerun your tools to produce the exact same results. They can analyze your tools to understand how you accomplished your workflow and can substitute their own data for the data provided in the package.
To create a package, right-click a result in the Results window and select Share As > Geoprocessing Package.
A geoprocessing package includes one or more results. Each result includes:
- The tool, which can be a system tool or a custom model or script tool that you created.
- The data used for input and output parameters for the tool.
- All other datasets needed to execute the tool, including project data. Project data is defined as data that is used within a model or script but not exposed as a parameter.
- Any other custom tools used by your tool. For example, if the model tool you're packaging runs other custom tools, these other tools will also be included in the package.
- The environment settings in effect when the tool was run.
Creating a geoprocessing package
To create a geoprocessing package, you start with a geoprocessing result. Geoprocessing results are created by the execution of a tool and are found in the Results window. A geoprocessing result contains all the information needed to create the package: data used in the input and output parameters, data used within your models or scripts, and the geoprocessing environments in effect when the tool was run, that is, all the information necessary allowing others to reexecute your workflow when shared.
In the Results window, right-click a result and select Share As > Geoprocessing Package. The Geoprocessing Package dialog box opens to guide you through the process of creating the package. From the Geoprocessing Package dialog box, you can:
- Specify whether you want to share your package to ArcGIS Online or save it to the local file system.
- Add additional results found in the Results window.
- Add additional files such as documentation files.
- Specify if you only want to package the schema of the input and output datasets rather than the data itself.
- Specify if you want to include your enterprise data or reference it.
- Specify if you want your package to support ArcGIS Runtime.
The Share As menu choice will be disabled for a result when:
- The result is invalid—a result that has an execution error .
- The Geoprocessing Package window or the Service Editor is already open.
- The result was created by executing a task within a geoprocessing service—only tools that execute on your computer can be shared.
- The result is from an execution of the Stage Service or Upload Service Definition tool—these tools cannot be packaged.
- The result uses a model tool that has list variables within the model—model tools that use list variables cannot be packaged.
Sharing a geoprocessing package
Geoprocessing packages can be shared by writing a geoprocessing package to disk as a .gpk file. Once you have created a .gpk file, it can be shared via e-mail, over a network, or uploaded to ArcGIS Online. Sharing to ArcGIS Online allows you to share your package with a much broader audience that you control by creating groups and setting permissions.
Using a geoprocessing package
The recipients of your package will be able to add it to ArcMap by:
- Clicking Open from within ArcGIS Online
- Double-clicking a .gpk from Windows Explorer
- Double-clicking a .gpk from an e-mail client
- Dragging and dropping a .gpk from the Catalog window or ArcCatalog into ArcMap
Once a package has been added to ArcMap, the input and output datasets will be added to the table of contents. The result that was packaged will be extracted to the Results window under the Shared node.
From the Results window, consumers (users) of your package will be able to investigate and understand the logic behind your workflow by:
- Studying the data that was used as inputs and how the outputs were created. These datasets are included in the package so your user will be able to see and work with the actual datasets used to create the result.
- Rerunning the workflow by right-clicking the shared result and selecting Re Run. Your user will be able to reexecute the workflow using the original input datasets that were included in the package or use their own datasets as input.
- Adding the shared result in ModelBuilder.