zoukankan      html  css  js  c++  java
  • arcengine 调用arctoolbox功能的举例 spatialJoin

    废话不多说,code是王道。

    其中str1、str2两个参数是target路径、join路径 


     private void spatialJoin(Geoprocessor gp, string str1, string str2)

            {
                ESRI.ArcGIS.AnalysisTools.SpatialJoin sj = new ESRI.ArcGIS.AnalysisTools.SpatialJoin();


                saveName("spatialJoin", getFileName(str1) + "_SpatialJoin.shp");


                sj.target_features = str1;


                sj.join_features = str2;


                sj.out_feature_class = getPathName(str1) + "_SpatialJoin.shp";


                sj.join_operation = "JOIN_ONE_TO_ONE";


                sj.match_option = "INTERSECTS";


                sj.join_type = "KEEP_ALL";


                if (sj.join_features != null || sj.target_features != null)
                {
                    IGeoProcessorResult results = null;


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


                    IGPUtilities pGPUtil = new GPUtilitiesClass();


                    IFeatureClass pFC;


                    IQueryFilter pQF;


                    pGPUtil.DecodeFeatureLayer(results.GetOutput(0), out pFC, out pQF);


                    int count = pFC.FeatureCount(null);      //统计Feature对象个数


                    IFeatureCursor pCursor = pFC.Insert(true);   //提取FeatureCursor对象


                    IFeatureLayer pFeatureLayer = new FeatureLayerClass();


                    pFeatureLayer.FeatureClass = pFC;


                    axMapControl1.Map.AddLayer(pFeatureLayer); 


                    result5.Text = "Spatial Join 完成!";


                }
                else
                    MessageBox.Show("请选择图层");
            }

  • 相关阅读:
    ORA-01219:数据库未打开:仅允许在固定表/视图中查询
    RMAN-08137: WARNING: Archived Log Not Deleted, Needed For Standby Or Upstream Capture Proces
    SSDB 安装部署及注意事项总结
    Keepalived安装与配置
    MongoDB安装与配置
    mysql数据库优化建议
    mysql数据库主从复制搭建
    MySQL MHA安装与配置
    CDH版本的hadoop下载
    centos7下载
  • 原文地址:https://www.cnblogs.com/dyllove98/p/3220232.html
Copyright © 2011-2022 走看看