private void toolStripButton1_Click(object sender, EventArgs e)
{
PIE.CommonAlgo.stBufferAnalyse_Exchange_Info info = new PIE.CommonAlgo.stBufferAnalyse_Exchange_Info();
info.strInputFile = @"D:\新建文件夹 (6)\Data\基础矢量\行政区划\线\国家界线.shp";
info.strOutputFile = @"D:\新建文件夹 (6)\Data\基础矢量\行政区划\线\国家界线.shp";
info.dbDistance = 3;
info.sideType = PIE.CommonAlgo.SideType.SideType_Left;//侧类型
info.fuseType = PIE.CommonAlgo.FuseType.FuseType_All;//融合类型
info.endCapStyle = PIE.CommonAlgo.EndCapStyle.EndCapStyle_Round;//末端类型
//2、创建算法对象
PIE.SystemAlgo.ISystemAlgo algo = PIE.SystemAlgo.AlgoFactory.Instance().CreateAlgo("PIE.CommonAlgo.dll", "PIE.CommonAlgo.BufferAnalysisAlgo");
if (algo == null) return;
algo.Name = "缓冲区分析";
algo.Params = info;
//3、执行算法并显示
bool result = PIE.SystemAlgo.AlgoFactory.Instance().ExecuteAlgo(algo);
if (result)
{
MessageBox.Show("执行成功");
ILayer layer = LayerFactory.CreateDefaultLayer(info.strOutputFile);
if (layer == null) return;
mapControlMain.ActiveView.FocusMap.AddLayer(layer);
mapControlMain.ActiveView.PartialRefresh(ViewDrawPhaseType.ViewAll);
}
}
View Code;