Custom Java Geoprocessing Tool - Delete Features


Purpose
This sample demonstrates how to create, deploy, and execute a custom geoprocessing tool developed in Java. The tool featured in this sample deletes features from the input feature class based on a SQL Expression and creates an output feature class from the results. This tool, therefore, requires 3 parameters: the feature class that contains features to be , the SQL expression that indicates the features to delete, and the output feature class that holds results.

How to use

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

How to execute this sample in ArcGIS Desktop?
  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/deletefeatures/lib) and copy DeleteFeaturesExt.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 JavaDFFunctionFactory 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 Delete Features 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.

How to execute this sample using an ArcGIS Engine Java application?
  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/deletefeatures/lib) and copy DeleteFeaturesExt.jar into the <$AGSENGINEJAVA/java/lib/ext folder to deploy the custom extension. The extension functionality will become available to your ArcGIS Engine Java app when the app is executed and Engine in initialized.
  3. Navigate to this sample's bin folder ($AGSDEVKITJAVA/java/samples/arcobjects/geoprocessing/deletefeatures/bin) and execute the DeleteFeatures.jar to run the console based application (the Eclipse IDE can also be used). This application will execute the custom geoprocessing tool.
  4. Examine the output messages on the console window.

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/DeleteFeaturesToolRunner.java Main class
geoprocessing/customtool/DeleteFeatures.java Geoprocessing tool class
geoprocessing/customtool/DFFunctionFactory.java Geoprocessing Function Factory class




Development licensing Deployment licensing
Engine Developer Kit Engine