首页 > 其他 > 详细

Executing a system tool

时间:2017-04-07 22:18:56      阅读:271      评论:0      收藏:0      [点我收藏+]

Executing a system tool

The following code example shows the execution of the Buffer tool from the Analysis tools toolbox. The required parameters for the tool are defined. In this case, strings are used to define the input, output, and buffer distance properties so the call to the tool is easier to read.
[C#]
// Add references to esriSystem for licensing and IVariantArray.
using ESRI.ArcGIS.esriSystem;
// Add a reference to the geoprocessing namespace.
using ESRI.ArcGIS.Geoprocessing;

private static void RunBuffer()
{
    // Create the geoprocessor.
    IGeoProcessor2 gp = new GeoProcessorClass();

    // Create an IVariantArray to hold the parameter values.
    IVariantArray parameters = new VarArrayClass();

    // Populate the variant array with parameter values.
    parameters.Add(@"D:\St_Johns\data.mdb\roads");
    parameters.Add(@"D:\St_Johns\data.mdb\roads_Buffer");
    parameters.Add("1000 Meters");

    // Execute the tool.
    gp.Execute("Buffer_analysis", parameters, null);
}

Executing a system tool

原文:http://www.cnblogs.com/gisoracle/p/6679717.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!