【注】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);
}