AE 直接调用GeoProcessing 工具

81 篇文章 0 订阅

Ae 直接调用GeoProcessing 工具

Geoprocessing是ArcGIS的一个基础组成部分。无论你是一个新手抑或老资格的专家,geoprocessing都是你使用ArcGIS完成每天工作的一部分。它提供了数据分析、数据管理和数据转换等对于所用GIS用户都必须的工具,当然也包括ArcObjects开发者。

 GIS程序通常需要操作和分析地理数据,如将数据集从一种投影转换为另一种投影,为表添加字段,或者为要素添加缓冲区。ArcGIS9包括了上百个geoprocessing工具来执行这些任务。本文将介绍ArcGIS Desktop和ArcGIS Engine用户如何中ArcObjects应用程序中使用这些geoprocessing工具。

 

Geoprocessor

Geoprocessor是简化调用geoprocessing工具任务的主要对象。这个对象是执行ArcGIS中任何geoprocessing工具的唯一访问点,它是一个粗粒度对象,包含了许多属性和方法,使得下面的操作变为可能:运行工具,设置全局环境参数;检查结果消息,执行批处理,访问数据属性。

Toolboxes为geoprocessor定义了一套工具,Toolboxes可以添加到geoprocessor中,也可以从中删除。(这句话的意思是,所有的geoprocessing都保存在Toolboxes中,Geoprocessor可以通过调用这些Toolbox的方式实现执行其中地理工具的目的;当然,它还可以直接调用工具类的方式执行)

 geoprocessor对象可以使用任何语言,包括VB,.NET和Java,来进行访问。本文所有的代码都将使用C#。帮助也为Java开发者提供了“Additional Resources for Programming with Geoprocessing Tools”资源。

ArcGIS9.2包含了一个新的.NET程序集ESRI.ArcGIS.Geoprocessor。它包含了一个被称为Geoprocessor的托管类。每一个ESRI提供的toolbox也都表现为一个托管程序集。在每一个toolbox程序集中,都拥有许多类来表示每个geoprocessing工具。工具类的都是使用Geoprocessor来调用和运行的。

(这句话的意思是我们还有第二种调用地理工具的方法,即直接访问其类).下面的例子展示了如何用AO来调用Geoprocessing.

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);
}
posted @ 2009-04-02 21:54 周文 阅读(50) 评论(0)   编辑 收藏 网摘 所属分类: Arc Engine

来自:http://www.cnblogs.com/tuncaysanli/archive/2009/04/02/1428519.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Although I’d taken a lot of programming classes in college, I never fully appreciated programming until I had a job that involved a lot of repetitive tasks. After amusing myself by automating much of that job, I decided to return to school and study biol- ogy, which is when I took my first GIS course. I was instantly in love, and managed to convince someone to give me a biology degree for writing an extension for ArcView GIS (a precursor to A rc GIS , for you Esri fans out there). After finishing that up, I went to work for the Remote Sensing/Geographic Information Systems Laboratory at Utah State University. One of my first projects involved some web mapping, and I soon became a big fan of the open source UMN M ap S erver software. That was my introduc- tion to open source geospatial software, including GDAL . I’m fairly certain that I didn’t appreciate the power of the GDAL/OGR library when I first learned about it, but I came to my senses once I started using it in my C++ and C# code. In the College of Natural Resources, there weren’t many people around who were interested in coding, but I did get to point people to the GDAL command-line utilities on a regular basis. But then Esri introduced Python as the scripting language of choice for A rc GIS , and things started to change. I don’t think I had used Python much before then, but playing with arcgisscripting (the original Esri Python module) made me realize how much I enjoyed working with Python, so naturally I had to start using GDAL with it as well. More importantly for this book, my coworker John Lowry suggested that we team- teach a Python-for- GIS class. He taught students how to use Python with A rc GIS , and I taught them about GDAL . The class turned out to be popular, so we taught it that way for another few years until John moved away. I took over the entire class and have been teaching it in various configurations ever since. I’ve never bothered to take the class material from the first two years off the web, however, which is how Manning found me. They asked if I would write a book on using GDAL with Python. I’d never had the desire to write a book, so it took a bit of persuasion to convince me to do it. In the end, it was my love for teaching that won me over. I’ve discovered over the years that I really enjoy teaching, mostly because I love watching students incorporate what they’re learning into the rest of their work. This is especially true of graduate students, some of whom might not have completed their research in a timely manner (or at all) if they hadn’t learned how to write code. I know that these skills will continue to assist them throughout their careers, and my hope is that this book will provide the same help to you, no matter if you’re a student, professional, or a hobbyist. This is fun stuff, and I hope you enjoy it as much as I do!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值