In this topic
About building custom geoprocessing tools
You can extend the geoprocessing functionalities of ArcGIS by building custom geoprocessing function tools to meet specific requirements, such as automating your geographic information system (GIS) tasks, building repeatable and well-defined methods and procedures, and modeling important geographic analysis to suit your geoprocessing needs. The custom tool you create can be integrated with the ArcGIS geoprocessing framework to behave in the same manner as an out-of-the-box ArcGIS geoprocessing tool. You can open and execute a custom geoprocessing tool from ArcToolbox, use it in ModelBuilder and chain the custom tool to out-of-the-box tools, and share it by publishing it on a server as a geoprocessing service.
Building a custom geoprocessing function tool requires the following three major steps:
Create a custom function tool
A geoprocessing function tool can be referred to as an operation that takes an input or set of inputs and generates one or more outputs. Therefore, you need to create a custom function tool class that defines the input and output of the tool and its operation. From a development perspective, a custom function tool can be considered a Plain Old Java Object (POJO) that implements specific geoprocessing framework interfaces.
For more information about creating a custom function tool, see Creating a custom function tool class.
Create a custom function factory
A function factory presents and manages geoprocessing tools. ArcGIS provides many out-of-the-box geoprocessing tools, which are located in ArcToolbox. The following screen shot shows the ArcToolbox window and some of the out-of-the-box geoprocessing tools:
In general, the out-of-the-box geoprocessing function tools in ArcToolbox are served through their corresponding function factories. To view these function factories and their tools, perform the following steps:
- Start ArcMap or ArcCatalog.
- Access ArcToolbox.
- Click New Toolbox and select the new toolbox.
- Click Add and click Tool.
In the Add Tool dialog box, find the list of ArcGIS function factories and the list of tools categorized and managed by each function factory. See the following screen shots:
The toolboxes in ArcToolbox are created from the out-of-the-box function factories by default. The toolboxes in ArcToolbox are synonymous with their function factory names.
Deploy to ArcGIS
After creating a custom geoprocessing function tool and its associated custom function factory, you must deploy the custom tool class and its function factory to ArcGIS. The Java .class files of the function tool and the function factory are bundled in a Java Archive (JAR) file and deployed to ArcGIS by placing the JAR file in the <ArcGIS Install Dir>/java/lib/ext folder.
An ArcGIS application (ArcGIS Engine, ArcMap, ArcCatalog, or ArcGIS Server) recognizes the JAR file as a custom geoprocessing function tool when the application is started. If the ArcGIS application is already running, you'll need to restart it after the JAR file is deployed. In the case of testing, if you modify the code in the Java classes that are bundled in the JAR file, the JAR file must be recreated and redeployed. You also need to restart the ArcGIS application after redeployment.
Once the custom geoprocessing function tool and function factory Java classes are created and deployed to ArcGIS, they can be accessed from ArcToolbox (in ArcMap or ArcCatalog) in the same manner as other ArcGIS geoprocessing tools.
In an ArcGIS Engine application, the deployed custom tool must be consumed by creating a toolbox. The toolbox that contains the custom geoprocessing tool must be published to the server and can be consumed in server applications in the same manner as other ArcGIS geoprocessing tools.
When you create a custom geoprocessing function tool, you also need to create a corresponding custom function factory to host and manage the custom function tool. A custom function factory can be considered a POJO that is annotated with @ArcGISExtension. The custom function factory implements specific interfaces of the geoprocessing framework.
For more information about creating a custom function factory, see Creating a custom function factory class.
For more information about accessing tools in ArcToolbox, see How to consume custom tools in ArcToolbox. For more information about creating a toolbox and consuming custom geoprocessing function tools in ArcGIS Engine applications, see How to consume custom geoprocessing tools in Java applications.
See Also:Building a custom geoprocessing tool in Eclipse IDE
Creating a custom function tool class
Creating a custom function factory class
|Development licensing||Deployment licensing|
|Engine Developer Kit||Engine|
|Server||ArcGIS for Desktop Basic|
|ArcGIS for Desktop Basic||ArcGIS for Desktop Standard|
|ArcGIS for Desktop Standard||ArcGIS for Desktop Advanced|
|ArcGIS for Desktop Advanced|