阅读:1438回复:1
获取图层的索引
大家好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; 我想获取我点击地物的 图层的 索引 怎么办啊 |
|
1楼#
发布于:2016-06-03 13:36
查询结果IFeature,获取IFeatureClass,和IMap的图层中的IFeatureClass进行遍历对比
|
|
|