• 自己做的关于select工具根据属性进行选择


     IFeatureLayer pFeLayer = axMapControl1.get_Layer(0) as IFeatureLayer;
                IDataLayer idata = pFeLayer as IDataLayer;
                IDatasetName idataname = idata.DataSourceName as IDatasetName;
                string path = idataname.WorkspaceName.PathName ;

              
                axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewAll, null, null);
                Geoprocessor gp = new Geoprocessor();
                gp.SetEnvironmentValue("workspace",path);
                gp.OverwriteOutput = true;
                ESRI.ArcGIS.AnalysisTools.Select pSelect = new Select();
                pSelect.in_features = pFeLayer .FeatureClass;
                pSelect.out_feature_class = @"E:\biancheng\3sdnMap\新地图\tiqu.shp";
                pSelect.where_clause = "GRIDCODE>50";
                gp.Execute(pSelect, null);
                IWorkspaceFactory pWspF = new ShapefileWorkspaceFactoryClass();
                IFeatureWorkspace pFW = (IFeatureWorkspace )pWspF.OpenFromFile(path,0);
                IFeatureClass pFeatureClass = pFW.OpenFeatureClass("tiqu");
                IFeatureLayer pFeatureLayer=new FeatureLayerClass () ;
                pFeatureLayer.FeatureClass = pFeatureClass;
                pFeatureLayer.Name = pFeatureClass.AliasName;
                axMapControl1.AddLayer(pFeatureLayer );

  • 相关阅读:
    windows 7鼠标右键另存为没有桌面选项
    我心目中的Asp.net核心对象
    谈谈C# 4.0新特性“缺省参数”的实现
    C#正则表达式
    Request[]与Request.Params[]
    智力题
    SQL Server类型与C#类型对应关系
    UPdatepanel 的 优点 缺点
    细说 Request[]与Request.Params[]
    display:block 前后会换行
  • 原文地址:https://www.cnblogs.com/weihongli/p/2167643.html
Copyright © 2020-2023  润新知