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 ...
随机推荐
- Android 6.0 权限请求
在申请权限之前一定要在清单配置文件中添加该权限private static final int MY_PERMISSIONS_REQUEST_RECORD_AUDIO = 1; //随便定义 publ ...
- Java中货币格式化
private final static NumberFormat CURRENCY_FORMAT = NumberFormat.getCurrencyInstance(Locale.CHINA); ...
- 关于Java加载属性文件放在web容器不好使的解决办法
//使用Spring的工具就行了1 import java.util.Properties; import org.springframework.core.io.support.Properties ...
- 山东省第七届ACM省赛------Fibonacci
Fibonacci Time Limit: 2000MS Memory limit: 131072K 题目描述 Fibonacci numbers are well-known as follow: ...
- Mac中安装node.js和npm
换了Mac需要安装noed.js和npm记录一下首先访问node.js官网(https://nodejs.org/en/download/) 点击下载完后,一路点安装 就安装完成了 然后打开-终端-输 ...
- 【前端】Node.js学习笔记
module.exports 使用方式: // File Name: hello.js function greet() {/*......*/} // 有下面这两种写法: // 1. module. ...
- 启动tomcat时,报错:IOException while loading persisted sessions: java.io.EOFException解决方法
报错原因:加载持久化session错误,tomcat加载时读取的文件是是*.ser,session序列化文件,文件的位置是tomcat\work\Catalina\localhost,找到sessio ...
- android 命名 数组 所有国家 String[] COUNTRIES
static final String[] COUNTRIES = new String[] { "Afghanistan", "Albania", " ...
- 关于去除Eclipse对JavaScript的验证
关于去除Eclipse对JavaScript的验证 在我们使用大量JavaScript作为一些UI或其他组件来使用时,很多情况下,明明引用的这些JavaScript是可以正常使用的,但Eclipse却 ...
- Spring MVC之@RequestBody, @ResponseBody 详解
http://blog.csdn.net/kobejayandy/article/details/12690555