ghl_729
外卖仔
外卖仔
  • 注册日期2004-03-05
  • 发帖数52
  • QQ29172636
  • 铜币278枚
  • 威望4点
  • 贡献值0点
  • 银元0个
阅读:1438回复:1

获取图层的索引

楼主#
更多 发布于:2016-05-27 10:01
 大家好if (e.button == 1 & bl == true)
            {
                IPoint ppoint = new PointClass();
                ppoint.X = e.mapX;
                ppoint.Y = e.mapY;


                toolStripStatusLabel1.Text = string.Format("{0}, {1}  {2}", e.mapX.ToString("#######.###"), e.mapY.ToString("#######.###"), axMapControl1.MapUnits.ToString().Substring(4));


                ITopologicalOperator ptopo;
                IGeometry pgeometry;
                IFeatureLayer pfeaturelayer;
                IFeature pfeature;
                IFeatureCursor pcursor;
                ISpatialFilter pfilter;


              
                    ppoint.PutCoords(e.mapX, e.mapY);


                    ptopo = ppoint as ITopologicalOperator;


                    double m =0.2;


                    pgeometry = ptopo.Buffer(m);


                    axMapControl1.Map.SelectByShape(pgeometry, null, true);


                    axMapControl1.Refresh(esriViewDrawPhase.esriViewGeoSelection, null, null);




                    pfilter = new SpatialFilterClass();


                    pfilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;


                    pfilter.Geometry = pgeometry;


                    pfeaturelayer = axMapControl1.Map.get_Layer(0) as IFeatureLayer;


                    pcursor = pfeaturelayer.Search(pfilter, false);


                    pfeature = pcursor.NextFeature();


                    string fieldname;


                    fiedname = pfeature.Fields.get_Field(3).Name;
我想获取我点击地物的 图层的 索引  怎么办啊
喜欢0 评分0
cl991036
管理员
管理员
  • 注册日期2003-07-25
  • 发帖数5913
  • QQ14265545
  • 铜币29655枚
  • 威望213点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • GIS帝国铁杆
1楼#
发布于:2016-06-03 13:36
查询结果IFeature,获取IFeatureClass,和IMap的图层中的IFeatureClass进行遍历对比
没钱又丑,农村户口。头可断,发型一定不能乱。 邮箱:gisempire@qq.com
举报 回复(0) 喜欢(0)     评分
游客

返回顶部