How to run a geoprocessing tool
How to run a geoprocessing tool |
In this topic
Running a geoprocessing tool
- Name—Each tool parameter has a unique name.
- Type—The type of data expected, such as feature class, integer, string, and raster.
- Required—Either a value must be provided for a parameter or it is optional.
[C#]
using ESRI.ArcGIS.Geoprocessor;
using ESRI.ArcGIS.AnalysisTools; public void SampleBufferTool()
{ // Initialize the geoprocessor.
Geoprocessor GP = new Geoprocessor(); ESRI.ArcGIS.AnalysisTools.Buffer bufferTool = new
ESRI.ArcGIS.AnalysisTools.Buffer(); bufferTool.in_features = @"D:\St_Johns\data.mdb\roads_Buffer";
bufferTool.out_feature_class = @"D:\St_Johns\data.mdb\roads";
bufferTool.buffer_distance_or_field = "distance"; GP.Execute(bufferTool, null); }
[VB.NET]
Imports ESRI.ArcGIS.Geoprocessor
Imports ESRI.ArcGIS.AnalysisTools Public Sub SampleBufferTool() ' Initialize the geoprocessor.
Dim GP As Geoprocessor = New Geoprocessor() Dim bufferTool As ESRI.ArcGIS.AnalysisTools.Buffer = New ESRI.ArcGIS.AnalysisTools.Buffer() bufferTool.in_features = "D:\St_Johns\data.mdb\roads_Buffer"
bufferTool.out_feature_class = "D:\St_Johns\data.mdb\roads"
bufferTool.buffer_distance_or_field = "distance" GP.Execute(bufferTool, Nothing) End Sub
Toolbox names | Namespaces |
3D Analyst tools | ESRI.ArcGIS.Analyst3DTools |
Analysis tools | ESRI.ArcGIS.AnalysisTools |
Conversion tools | ESRI.ArcGIS.ConversionTools |
Data Management tools | ESRI.ArcGIS.DataManagementTools |
Cartography tools | ESRI.ArcGIS.CartographyTools |
Coverage tools | ESRI.ArcGIS.CoverageTools |
Geocoding tools | ESRI.ArcGIS.GeocodingTools |
Geostatistical Analyst tools | ESRI.ArcGIS.GeostatisticalAnalystTools |
Linear Referencing tools | ESRI.ArcGIS.LinearReferencingAnalystTools |
Multidimension tools | ESRI.ArcGIS.MultidimensionTools |
Network Analyst tools | ESRI.ArcGIS.NetworkAnalystTools |
Samples | ESRI.ArcGIS.SamplesTools |
Spatial Analyst tools | ESRI.ArcGIS.SpatialAnalystTools |
Spatial Statistics tools | ESRI.ArcGIS.SpatialStatisticsTools |
Running custom geoprocessing tools
Executing a tool by name
[C#]
using ESRI.ArcGIS.Geoprocessor;
using ESRI.ArcGIS.esriSystem; public void SampleCalculateBestPathTool()
{ // Initialize the geoprocessor.
Geoprocessor GP = new Geoprocessor(); // Add the BestPath toolbox.
GP.AddToolbox(@"C:\SanDiego\BestPath.tbx"); // Generate the array of parameters.
IVariantArray parameters = new VarArrayClass();
parameters.Add(@"C:\SanDiego\source.shp");
parameters.Add(@"C:\SanDiego\destination.shp");
parameters.Add(@"C:\SanDiego\bestpath.shp"); // Execute the model tool by name.
GP.Execute("CalculateBestPath", parameters, null); }
[VB.NET]
Imports ESRI.ArcGIS.Geoprocessor
Imports ESRI.ArcGIS.esriSystem Public Sub SampleCalculateBestPathTool() ' Initialize the geoprocessor.
Dim GP As Geoprocessor = New Geoprocessor() ' Add the BestPath toolbox.
GP.AddToolbox("C:\SanDiego\BestPath.tbx") ' Generate the array of parameters.
Dim parameters As IVariantArray = New VarArrayClass()
parameters.Add("C:\SanDiego\source.shp")
parameters.Add("C:\SanDiego\destination.shp")
parameters.Add("C:\SanDiego\bestpath.shp") ' Execute the model tool by name.
GP.Execute("CalculateBestPath", parameters, Nothing) End Sub
How to run a geoprocessing tool的更多相关文章
- Unable to run mksdcard SDK tool.
Ubuntu 14.04,安装android studio后运行出错,sdk manager不能正常运行 Unable to run mksdcard SDK tool. 原因,缺少运行需要的库:li ...
- ubuntu15.10运行android studio出错unable to run mksdcard sdk tool
问题:ubuntu运行android studio出错unable to run mksdcard sdk tool 系统版本:系统是ubuntu 15.10 64位 确认原因:缺少lib 解决方法: ...
- Android studio Unable to run mksdcard SDK tool
/******************************************************************************************** * Andr ...
- Create a geoprocessing tool to buffer a layer and retrieve messages____sync
using System.Drawing; using System.Text; using System.Windows.Forms; using System.Runtime.InteropSer ...
- android studio 安装报错 unable to run mksdcard sdk tool
搜了一下原来缺少这个 sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6
- ubuntu运行android studio出错unable to run mksdcard sdk tool
原因:缺少lib 解决方法: sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6 完美解决.
- centos7安装android studio遇到Unable to run mksdcard sdk tool
centos系统为最小化安装,所以安装新软件时缺少许多依赖包,Android Studio下载的mksdcard是32位的,而系统是64位的,所以需要安装支持32位软件的依赖包. sudo yum i ...
- GP中Geoprocessor.Execute(string name, IVariantArray parameters, ITrackCancel trackCancel)
在做一个项目的过程中,发现GP运算方法 Execute(string name, IVariantArray parameters, ITrackCancel trackCancel) 与Execut ...
- The Topo to Raster tool returns errors 010235 and 010067转
Problem: The Topo to Raster tool returns errors 010235 and 010067 Description The Topo to Raster geo ...
随机推荐
- Python基础操作-函数
本节内容 1. 函数基本语法及特性2. 参数与局部变量3. 返回值4.递归5.高阶函数 1.函数基本语法及特性函数是什么? 函数一词来源于数学,但编程中的「函数」概念,与数学中的函数是有很大不同的,具 ...
- CI框架--事务
CI框架中事务封装的很完善,使用起来很简单 1.不开启事务 //不开启事务 前两个sql 能够执行成功,第三个执行失败 $this->device_model->addForCamera( ...
- ping命令脚本实现显示网络状态、学生姓名、学号
#!/bin/bash a=. ####定义一个固定变量 h=(wanghao xieyunshen 刘桃) ####定义数组 ..} ####for循环,后面的in是条件即从多少循环到多少 do # ...
- 20161014001 DataGridView 单元格内容 自动计算
private void T_Form_CY_CBD_D_CellValueChanged(object sender, DataGridViewCellEventArgs e) { ...
- up_modembin.sh
--- 编译modem生成bin文件cp到指定文件夹 up_modembin.sh #!/bin/bash flag=${} == $flag ];then # echoMsg find vendor ...
- 在MAC服务器上搭建docker-registry(转)
在MAC服务器上搭建docker-registry 2014-03-14 0个评论 来源:在MAC服务器上搭建docker-registry 收藏 我要投稿 本文介绍如何在M ...
- VC++2013出现bug: 无法打开源文件“stdafx.h”
VC++2013出现bug: 无法打开源文件“stdafx.h” 1.首先需要把#include "stdafx.h"置于最头 2.在解决方案资源管理器中添加以下几个文件(附图下)
- 读《编写可维护的JavaScript》第八章总结
第八章 避免“空比较” 我们在对传进来的参数做处理之前,肯定需要验证一下是否是我们想要的,也就是说大多数情况下,我们需要对比一下它的类型. 作者首先给了一个看起来都感觉不对的代码: var Contr ...
- 将JSON对象带有格式的写出到文件中
需求:将一个JSON对象写出到文件中,要求文件中的JSON数据带有简单的格式.代码的实现参考了Java算法中的栈处理括号匹配问题.好了,不多说了,下面是代码的实现. 代码: package gemu. ...
- 切换npm源
直接切换源: npm install --registry=https://registry.npm.taobao.org 另: (仅用于学习参考使用) 参考: http://www.xuebuyua ...