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 ...
随机推荐
- java htmlunit 抓取网页数据
WebClient webClient=new WebClient(BrowserVersion.CHROME); webClient.setJavaScriptTimeout(5000); webC ...
- Hello Spring Framework——面向切面编程(AOP)
本文主要参考了Spring官方文档第10章以及第11章和第40章的部分内容.如果要我总结Spring AOP的作用,不妨借鉴文档里的一段话:One of the key components of S ...
- 怎样获取Windows平台下SQL server性能计数器值
转载自工作伙伴Garrett, Helen "SQL Server Performance Counter captures" Capturing Windows Performa ...
- 剑指offer:赋值运算符函数和复制构造函数
赋值运算符函数 对于定义一个赋值运算符函数时,需要注意一下几点: (1)函数的返回类型必须是一个引用,因为只有返回引用,才可以连续赋值 (2)传入的参数声明为常量引用,可以提高代码效率,同时赋值运算函 ...
- linux下打开、关闭tomcat,实时查看tomcat运行日志
启动:一般是执行sh tomcat/bin/startup.sh 停止:一般是执行sh tomcat/bin/shutdown.sh脚本命令 查看:执行ps -ef |grep tomcat 输出如下 ...
- knockoutjs(二)
Observables(监控属性)Knockout是在下面三个核心功能是建立起来的: 1监控属性(Observables)和依赖跟踪(Dependency tracking) 2声明式绑定(Decla ...
- EF之ExecuteSqlCommand更新出现无效的解决方案
本篇文章将会剖析为什么会出现这一现象.以及解决的办法 先来看一下代码 public static TResult AddTest() { TestDAL testdal = DALFactory.Cr ...
- Android first --- 单元测试框架junit
#单元测试junit* 定义一个类继承AndroidTestCase,在类中定义方法,即可测试该方法 * 在指定指令集时,targetPackage指定你要测试的应用的包名 <instrumen ...
- 初涉java库--ArrayList
我的车就差一个轮子啦,造好轮子,我就飞上天与太阳肩并肩啦,想想都激动.什么你要自己造轮子,是不是傻,商店里不都是别人造好的吗,又好又方便,只需一点money,你没有money,那你只能做个安静的美男子 ...
- 关于freemaker的一点使用技巧
在做国泰君安2016年中秋送电影票活动中,需要做这样一个手机页面,展示所有中奖用户的中奖信息.如下图: 要求对用户的后记号码中间5位做隐藏处理.最开始的处理方法是在对用户实体的get()方法做处理 / ...