AE调用GP

2024-02-21 10:38
文章标签 调用 ae gp

本文主要是介绍AE调用GP,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

借用别人的东西,将这两种方法放在一起:

第一种,分别设置参数:


 

//添加命名空间using ESRI.ArcGIS.esriSystem;using ESRI.ArcGIS.Geoprocessor;//实现button click方法private void button1_Click(object sender, EventArgs e){//构造GeoprocessorGeoprocessor gp = new Geoprocessor();//设置参数ESRI.ArcGIS.AnalysisTools.Intersect intersect = new ESRI.ArcGIS.AnalysisTools.Intersect();intersect.in_features = @"F:\foshan\Data\wuqutu_b.shp;F:\foshan\Data\world30.shp";intersect.out_feature_class = @"E:\intersect.shp";intersect.join_attributes = "ONLY_FID";//执行Intersect工具RunTool(gp, intersect, null);}private void RunTool(Geoprocessor geoprocessor, IGPProcess process, ITrackCancel TC){// Set the overwrite output option to truegeoprocessor.OverwriteOutput = true;try{geoprocessor.Execute(process, null);ReturnMessages(geoprocessor);}catch (Exception err){Console.WriteLine(err.Message);ReturnMessages(geoprocessor);}}// Function for returning the tool messages.private void ReturnMessages(Geoprocessor gp){string ms = "";if (gp.MessageCount > 0){for (int Count = 0; Count <= gp.MessageCount - 1; Count++){ms += gp.GetMessage(Count);}}


另一种添加参数:

//1-定义GeoProcessor对象Geoprocessor gp = new Geoprocessor();object sev = null;//2-设置参数gp.OverwriteOutput = true;//3-设置工具箱所在的路径gp.AddToolbox(@"F:\lib_test\AirportsAndGolf.tbx");//4-设置输入参数IVariantArray parameters = new VarArrayClass();parameters.Add(@"F:\lib_test\地下水重金属数据.xls\Sheet1$");parameters.Add("`YEAR` = 2009");parameters.Add("W20111");parameters.Add(@"F:\lib_test\temp.gdb\tempwww");//5-执行工具gp.Execute("ModelAnalysis", parameters, null);


 

ESRI官方帮助示例:

1.

using ESRI.ArcGIS.Geoprocessor;
using ESRI.ArcGIS.AnalysisTools;public void SampleBufferTool()
{// Initialize the geoprocessor. Geoprocessor GP = new Geoprocessor();ESRI.ArcGIS.AnalysisTools.Buffer bufferTool = newESRI.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);}

2.

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);
转自http://blog.csdn.net/lysc_forever/article/details/7674332

这篇关于AE调用GP的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/731498

相关文章

ScrollView 非手动调用的方法

1. /**  *  非人为的时候调用这个方法  *  *  @param scrollView <#scrollView description#>  */ - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView {           } 2.判断控制器的view是否加载过 [willShowVC

在WinCE的C#编程中,需要静态调用C++的动态库,需要添加using System.Runtime.InteropServices

using System.Runtime.InteropServices;         [DllImport("Win32DLL.dll", EntryPoint = "WriteREG_SZToRegTCHAR")]         private static extern bool WriteREG_SZToRegTCHAR(int iFlag, string regKeyP

PHP中静态(static)调用非静态方法详解

1.PHP中可以静态调用非静态方法么? 今天我被问到PHP中可不可以使用 className::methodName() 的方法来调用一个没有声明static的方法。在我的印象中,我好像是见过这种用法,但又有些不确定。大家都知道,在手册或者教程里,方法被分为静态方法 和非静态方法,通常我们静态调用的方法,肯定是静态方法。 那如果我们调用了非静态方法会怎么样呢?首先做测试。 1

如何利用AopContext.currentProxy()解决事务管理中的方法调用问题

在Spring应用开发中,使用AOP(面向切面编程)来管理事务是非常常见的做法。然而,在某些场景下,尤其是在同一个类的方法内部,一个非事务方法直接调用另一个带有事务注解的方法时,可能会遇到事务不生效的问题。本文将深入探讨这一问题的原因,并介绍如何通过AopContext.currentProxy()方法来有效解决这一问题。 问题背景 想象一下,你有一个服务类UserService,其中包含两个方法

调用FileOutputStream中的三种write方式

package fileoutputstream;import java.io.FileOutputStream;import java.io.IOException;//import java.io.OutputStream;public class FileOutputStreamDemo2 {public static void main(String[] args) throws I

android的adb详解(多设备时adb调用)

在多设备(模拟器)时,想要直接用logcat查看其中一台的状态,或者直接把应用安装到目标设备上时,需要指定设备号。 adb devices 这个指令可以得到当前设备的序列号(serialNumber)。 比如一个模拟器通常是 emulator-5554 在adb的指令后面加上参数 -s <serialNumber> 比如 -s emulator-5554 就可以指定a

vue3中子组件调用父组件事件

在 Vue 3 中,子组件调用父组件的事件(或方法)的方式与 Vue 2 类似,但 Vue 3 引入了 Composition API,这可能会改变你组织代码的方式。不过,基本的通信机制——通过自定义事件 ($emit) 通知父组件——仍然保持不变。 以下是如何在 Vue 3 中使用 Options API 和 Composition API 的示例: 使用 Options API 父组件

Android不能调用java.awt的原因及解决办法和思考

android 里面不能使用awt,底层没有具体的实现awt android里面的窗口创建过程决定了界面只能是android里面的组建。 android的组件都是通过远程的IPC调用完成的,也就是说服务端有什么功能才能用什么功能。 不是所有用java写的程序都能在标准jvm中运行的。 android中的虚拟机是修改过的,跟标准的JVM不同,比如对一张图片的解析,android

编写android程序调用jni本地方法的实现(详细例子)

在写android程序的时候会用到jni,接下来的代码讲诉C实现,环境配置请看我其他的博客,不多说,直接上代码,代码上几乎每一句都会解释,绝对易懂 MainActivity中的代码: package com.ndk.test;import java.io.UnsupportedEncodingException;import com.example.testndk.R;import an

linux下的cmos摄像头驱动设计2-应用程序的调用与驱动程序的关系

上一篇写了,摄像头驱动的注册过程,这次写写应用程序的调用与驱动程序的关系,遵循V4L2架构的应用程序主要由几个ioctl组成, 其实也比较简单,有时候驱动写的不标准,应用程序按标准的操作操作就不行,出不来图像,这时需要跟踪驱动程序,看看哪个地方出错了, 首先,要打开设备   1.fd = open(dev_name, O_RDWR /* required */| O_NONBLOCK, 0)