Custom Java geoprocessing tool - Create Buffer


Purpose
This sample demonstrates how to create a custom Java geoprocessing tool that encapsulates a system geoprocessing tool. This Java tool creates a buffer for a supplied feature class. However, it does not use its own logic to create a buffer; it delegates the task to the System Buffer tool that resides in the Analysis toolbox.
This Java application that consumes this GP tool cannot be run from the command line or from inside an integrated development environment (IDE). Follow the instructions below to run this application.

How to use

See How to use ArcGIS samples for help on running the sample.

How to use this sample?
  1. Verify that the ArcObjects Java SDK is installed on your computer.
  2. Navigate to this sample's lib folder ($AGSDEVKITJAVA/java/samples/arcobjects/geoprocessing/customtools/createbuffer/lib) and copy CreateBufferExt.jar into the <$AGSDESKTOPJAVA/java/lib/ext folder to deploy the custom extension. The extension functionality will become available to you when you restart ArcMap or ArcCatalog.
  3. Open ArcMap or ArcCatalog and expand Toolboxes.
  4. Create a new toolbox under My Toolboxes.
  5. Right click the newly created toolbox and select Add -> Tool.
  6. Select JavaCBFunctionFactory from the list of toolboxes. Optionally, you could expand toolbox node and view the toolset and tool embedded within. Click OK.
  7. Verify that the Java Create Buffer Tool is added to your toolbox.
  8. Double-click the custom tool and provide values for all the parameters.
  9. Click OK to execute the tool.
  10. Examine results.

If you installed the samples feature, you will find the files associated with this sample in <Your Developer Kit install location>\DeveloperKit10.4\Java\Samples\ArcObjects.

geoprocessing/customtool/CreateBuffer.java Geoprocessing tool class
geoprocessing/customtool/CBFunctionFactory.java Geoprocessing Function Factory class




Additional Requirements
  • ArcGIS Desktop Installed (ArcCatalog)

Development licensing Deployment licensing
Engine Developer Kit Engine
ArcGIS for Desktop Basic