AE:图层的叠置(Intersect)

【注】ae图层的叠置主要实现类Geoprocessor,通过调用其Execute函数就可以,但执行前要

/// <summary>到入库

using ESRI.ArcGIS.DataManagementTools;

using ESRI.ArcGIS.Geoprocessing;

using ESRI.ArcGIS.Geoprocessor;

using ESRI.ArcGIS.AnalysisTools;

/// Intersect  事件

/// </summary>

/// <param name="sender"></param>

/// <param name="e"></param>

private void button5_Click(object sender, EventArgs e)

{

    Intersect interset = new Intersect();

 

 

    object in_features = null, out_feature_class = null;

    string output_type = "INPUT";

    string join_attributes = "ALL";

    double cluster_tolerance = 0.01;

 

    in_features = "D:Demo.mdb//A #; D://CodeEx//gAeExplore//Data//Demo.mdb//TesDLTBt #";

    out_feature_class = "D://CodeEx//gAeExplore//Data//Demo.mdb//Intersect";

    interset.in_features  = in_features;  //"地类图斑 #;sde.DBO.C20_region #"

    interset.out_feature_class = out_feature_class;  //D:/tt/DLTB_C20_Intersect.shp

    interset.output_type = output_type;  //INPUT;LINE;POINT

    interset.join_attributes = join_attributes; //ALL;NO_FID;ONLY_FID

    interset.cluster_tolerance = cluster_tolerance;

 

    Geoprocessor gp = new Geoprocessor();

 

    gp.OverwriteOutput = true;

    gp.AddOutputsToMap = true;

    gp.ClearMessages();

    IGeoProcessorResult results = null;

    string Message = "";

    results = (IGeoProcessorResult)gp.Execute(interset, null);

 

    if (results != null && results.Status == esriJobStatus.esriJobSucceeded)

    {

        object sf = new object();

        Message += gp.GetMessages(ref sf);

       

    }

    else

    {

        Message = "执行失败.";

        object sf = new object();

        Message+= gp.GetMessages(ref sf);

       

    }

    if (gp != null)

    {

        gp = null;

    }

   MessageBox.Show(Message);

 

}

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值