zoukankan      html  css  js  c++  java
  • Accessing tools within a VB6 program AE中使用VB调用Geoprocessing

    用这种方法可以调用所有Toolbox中工具,只要具备许可。总体感觉没有python方便。

    In VB, you execute any tool through the Execute method of the GeoProcessor object. In
    order to access any method or property of the GeoProccessor object you first need to
    declare an IGeoProccessor variable and set it to GeoProccessor object. You set the
    parameters of a tool through a variant array. Populate the variant array with each
    parameter in the same sequence as the usage of tool would show. You must ensure all the
    properties marked as required are set; you may also wish to set properties marked as
    Optional. See the example below showing how to access the Erase tool and set its
    parameters:

    '//Initialize the Geoprocessor
    Dim GP As IGeoProcessor
    Set GP = New GeoProcessor
    '//Declare 3 variables for input and output parameters
    Dim in_features As String
    Dim erase_features As String
    Dim out_features As String
    '//Define the input/output parameter variables
    in_features = "C:\data\erase\Input.shp"
    erase_features = "C:\data\erase\Erase.shp"
    out_features = "C:\data\erase\Output.shp"
    '//Declare and set a variant array to hold the parameters
    Dim parameters As IVariantArray
    Set parameters = New VarArray
    '//Populate the variant array with the parameters
    parameters.Add (in_features)
    parameters.Add (erase_features)
    parameters.Add (out_features)
    '//Now execute the Erase tool
    GP.Execute "Erase", parameters, Nothing

    Below are the system toolbox names and their aliases:
    ? Analysis Tools— analysis
    ? Conversion Tools— conversion
    ? Data Management Tools— management
    ? 3D Analyst Tools— 3d
    ? Cartography Tools— cartography
    ? Geocoding Tools— geocoding
    ? Geostatistical Analyst Tools— ga
    ? Linear Referencing Tools— lr
    ? Multidimension Tools— md
    ? Network Analyst Tools— na
    ? Samples— samples
    ? Spatial Analyst Tools— sa
    ? Spatial Statistics Tools— stats

     

    中文可参考《学习在 ArcEngine 中使用 Geoprocessing》,写得比较仔细。

  • 相关阅读:
    致虚极守静笃
    DNS 透明代理
    Java“禁止”泛型数组
    Java和C#语法对比
    JVM 内存区域 (运行时数据区域)
    Java8 使用
    G1收集器的收集原理
    BZOJ 2222: [Cqoi2006]猜数游戏【神奇的做法,傻逼题,猜结论】
    数据结构之网络流入门(Network Flow)简单小节
    BZOJ 1257: [CQOI2007]余数之和sum【神奇的做法,思维题】
  • 原文地址:https://www.cnblogs.com/flyingfish/p/1077205.html
Copyright © 2011-2022 走看看