In this topic
How to run a geoprocessing tool(这个地方在仔细整理下!!)
Each geoprocessing tool has a fixed set of parameters that provide the tool with the information it needs for execution. Tools usually have input parameters that define the dataset or datasets that will typically be used to generate new output data. Parameters have the following important properties:
- Name—Each tool parameter has a unique name.
- Type—The type of data expected, such as a feature class, integer, string, and raster.
- Required—Either a value must be provided for a parameter, or it is optional.
Each tool has a documentation page known as a tool reference page.For more information about parameters, see Interpreting a tool reference page.(Interpreting:解释。在这个页面介绍了怎么快速定位“工具”,找到工具名称和工具参数信息,一定要了解这个专题上的信息,你才能很好地使用ArcGIS的工具。其实,你在使用ArcMap的系统工具的时候,在工具的帮助文档里,就能找到那个工具的名称,别名,参数,还有部分的Python代码。)
When a tool is used in a program, its parameter values must be set correctly so it can execute when the program runs. The documentation of each tool clearly defines its parameters and properties. Once a valid set of parameter values is provided, the tool is ready to be executed.
Parameters are specified as strings or objects. Strings are text values that uniquely identify a parameter value, such as a path to a dataset or a keyword. Most tool parameters can be specified as a simple string. However, complex parameters, such as a spatial reference, can be easier to specify with an object. Each tool has its own parameter types.To get complete information on a particular tool, review the tool reference page. Interpreting a tool reference page explains how to read a tool reference page and extract information to use in .NET.
两种方法的区别:Geoprocessing & geoprocessor
You can run a geoprocessing tool by using the Geoprocessing library methods or by the geoprocessor managed assembly methods. For information about the basic differences between the two approaches, seeExecuting tools. In both cases, the Execute method of the geoprocessor is called.
取消即终止功能通常设为null
The Execute method uses a null reference instead of an ITrackCancel interface. The ITrackCancel interface provides access to properties and methods that determine if a cancellation has been executed by the user and also allows developers to specify what actions constitute a cancellation. Both approaches are elaborated(详细阐述如下) with the following examples.
Using the geoprocessing assembly(是一个COM Interop程序集)
The geoprocessing assembly is the Component Object Model (COM) interop of the Geoprocessing type library(
什么是COM Interop?COM Interop看上去象是介乎于COM和.Net之间的一条纽带,一座桥梁。
). The Execute method of the
IGeoProcessor2
interface of the library is used to run a tool.
The following are the generic steps to execute a tool:
- Add a reference toESRI.ArcGIS.Geoprocessingto your project. This is the