码迷,mamicode.com
首页 > 其他好文 > 详细

gp工具的许可

时间:2019-01-15 18:29:49      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:too   bak   .sh   oid   ram   pre   src   ati   initial   

技术分享图片

还是要在代码里许可

    static class Program
    {
        [STAThread]
        static void Main()
        {            ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop);
            IAoInitialize aoInitialize = new AoInitialize();
            esriLicenseStatus licenseStatus = esriLicenseStatus.esriLicenseUnavailable;
            licenseStatus = aoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeAdvanced);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }

比如

        IGeoProcessorResult ret = null;
        private void button1_Click(object sender, EventArgs e)
        {
            string sInputPath = @"x:\aa\test\test320902.gdb\DLG\XZDW";
            string sOutPutPath = @"x:\aa\test\test320902.gdb\DLG\XWM_BUFFER_BAK";
            ESRI.ArcGIS.AnalysisTools.Buffer pBufferTool = new ESRI.ArcGIS.AnalysisTools.Buffer();
            pBufferTool.in_features = sInputPath;
            pBufferTool.out_feature_class = sOutPutPath;
            pBufferTool.buffer_distance_or_field = "BufferKD";
            pBufferTool.dissolve_option = "ALL";
            pBufferTool.line_side = "FULL";
            pBufferTool.line_end_type = "FLAT";
            Geoprocessor gp2 = new Geoprocessor();
            gp2.OverwriteOutput = true; 
            gp2.ToolExecuted += Gp2_ToolExecuted;   
            ret = gp2.ExecuteAsync(pBufferTool);
        }

        private void Gp2_ToolExecuted(object sender, ToolExecutedEventArgs e)
        {
            MessageBox.Show(ret.GetMessage(0));
        }

  

gp工具的许可

标签:too   bak   .sh   oid   ram   pre   src   ati   initial   

原文地址:https://www.cnblogs.com/yansc/p/10273417.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!