[AE] 缓冲区分析


  1. 添加库

    using ESRI.ArcGIS.AnalysisTools; 
    using ESRI.ArcGIS.Geoprocessor;
    
  2. 获得输入、输出文件路径

    string pPath = @"C:\tmp.shp";
    string outPath = @"C:\buffer.shp";
    
  3. 创建地理处理

    Geoprocessor pGp = new Geoprocessor();
    pGp.OverwriteOutput = true; //允许运算结果覆盖现有文件,可无
    
  4. 使用AE中自带的缓冲区分析工具

    ESRI.ArcGIS.AnalysisTools.Buffer pBuffer = new ESRI.ArcGIS.AnalysisTools.Buffer();
    pBuffer.in_features = pPath; //输入文件
    pBuffer.out_feature_class = outPath; //输出路径
    pBuffer.buffer_distance_or_field = "5000 Meters"; //缓冲区参数
    pBuffer.dissolve_option = "ALL"; //融合缓冲区重叠交叉部分
    pGp.Execute(pBuffer, null); //执行
    
  5. 添加结果到窗口(可无)

    string pFolder = System.IO.Path.GetDirectoryName(outPath); //得到字符串中文件夹位置
    string pFileName = System.IO.Path.GetFileName(outPath); //得到字符串中文件名字
    axMapControl1.AddShapeFile(pFolder, pFileName); //往地图控件里添加文件
    axMapControl1.ActiveView.Refresh(); //激活窗口刷新
    

转载自:https://blog.csdn.net/summer_dew/article/details/79191163

You may also like...