This document is archived and information here might be outdated.  Recommended version.

Geoprocessing assembly overview (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > Developing with ArcGIS > Learning ArcObjects > Using geoprocessing > Geoprocessing assembly overview

Geoprocessing assembly overview

In this topic

About the Geoprocessing assembly

The Geoprocessing assembly is Component Object Model (COM)-based unmanaged code. The .NET Framework interacts with the Geoprocessing library through COM interop. ESRI supplies the primary interop assemblies (PIAs) for this type library (along with the PIAs of all other type libraries). The Geoprocessing interop assembly enables a .NET client to seamlessly create instances of COM types and call its methods as though they were native .NET instances.
The Geoprocessing library is imported as the ESRI.ArcGIS.Geoprocessing namespace. All COM coclasses are converted to managed classes - for example, the GeoProcessor coclass is converted to GeoProcessorClass ("Class" is appended to the original name). The Geoprocessing library has hundreds of coclasses, all of which are available in .NET once you reference the ESRI.ArcGIS.Geoprocessing namespace to your project. Once the namespace is added to your project, you can seamlessly interact with those classes.
Creating the geoprocessor object
Use the following example to create the geoprocessor object while using the Geoprocessing assembly:
ESRI.ArcGIS.Geoprocessing.IGeoProcessor2 gp=new
Dim gp As ESRI.ArcGIS.Geoprocessing.IGeoProcessor2
gp=New ESRI.ArcGIS.Geoprocessing.GeoProcessor
Many code examples in the topics under Geoprocessing are written as functions. Note the parameter signature for the geoprocessor object. The signature of GeoProcessor2 gp uses the Geoprocessing library where as Geoprocessor gp uses the managed Geoprocessor assembly.
Useful interfaces in the geoprocessing assembly
Of the hundreds of coclasses and interfaces in the Geoprocessing library, the most important one is the IGeoProcessor2 interface of the GeoProcessor coclass. You need a reference to IGeoProcessor2 if you're using the geoprocessing tools. The following are other commonly used interfaces:
  • IGeoProcessorResult2 - used to interrogate the result object.
  • IGPUtilities3 - A helper coarse-grained ArcObjects component that simplifies workflow.
  • IGpEnumList - Some IGeoProcessor2 methods return IGpEnumList.
  • IGPServer2 - Works with geoprocessing services.
You will need to reference various other interfaces for atypical geoprocessing tasks, such as the following:
  • IGpValueTableObject to work with value tables.
  • IGPToolCommandHelper to launch a tool from a button.
  • IDataElement and data element objects to access dataset properties.
  • IGPFieldMapping and IGPFieldMap to map fields.
With the exception of the IGeoProcessor2 interface, none of the coclasses and interfaces is available through Geoprocessor (lowercase p) managed assembly. If you're using the Geoprocessor managed assembly, you also need to reference the ESRI.ArcGIS.Geoprocessing namespace to access the above mentioned interfaces. For more information, see Geoprocessor managed assembly.

Creating tools

You can leverage the full power of the geoprocessing framework by creating your own function tool by implementing the IGPFunction2 and IGPFunctionFactory interfaces. For more information, see Custom geoprocessing function tools. Before you create your own function tool, read Using geoprocessing to develop applications first.
You can also create a script tool using an executable as the source of the tool. For more information, see How to create a script tool that runs an EXE.

See Also:

Using ArcObjects (COM-based) in .NET
How to run a geoprocessing tool

To use the code in this topic, reference the following assemblies in your Visual Studio project. In the code files, you will need using (C#) or Imports (VB .NET) directives for the corresponding namespaces (given in parenthesis below if different from the assembly name):