IMap.FeatureSelection方法获取Feature的属性信息
来源:互联网 发布:高中英语听力训练软件 编辑:程序博客网 时间:2024/06/04 17:53
近日在通过 IMap.FeatureSelection 获取了地图的选择集要素之后,发现获取的 IFeature 对象属性信息都是空的。感到很奇怪,仔细看了一下文档,发现如下的描述:
only the shape field is guaranteed with the selection. This is the default and exists for performance reasons. The IMap::FeatureSelection property is typically used to draw the map selection, not access feature attributes. This is particularly noticeable with shapefiles and coverage but also in geodatabases if the selection is large enough. Use IEnumFeatureSetup::AllFields to set a flag indicating all fields be returned with the selection. If you want to loop through the map selection to perform an operation, it is typically best to access each layer's selection rather than the entire map's selection. See the example for a sample of each. 。
原来出于性能方面的考虑,该接口默认只返回 shape 信息, FeatureSelection 方法主要是用来获取选中要素进行绘制,不需要访问属性信息。可以通过 IEnumFeatureSetup::AllFields 方法来设置允许返回属性。如果要遍历地图中的选择集,最好是通过 Layer 来获取选择集,比这种方法好。
IMap 获取选择集属性信息的方法如下:
// 获取选择集
ISelection pSelection = axMapControl1 .Map .FeatureSelection ;
// 打开属性标签
IEnumFeatureSetup pEnumFeatureSetup = pSelection as IEnumFeatureSetup ;
pEnumFeatureSetup .AllFields = true ;
// 读取属性
IEnumFeature pEnumFeature = pSelection as IEnumFeature ;
IFeature pFeature = pEnumFeature .Next ();
while (pFeature != null )
{
Console .WriteLine (pFeature .get_Value (2));
pFeature = pEnumFeature .Next ();
}
- IMap.FeatureSelection方法获取Feature的属性信息
- IMap.FeatureSelection方法获取Feature的属性信息
- ArcEngine中使用IMap.FeatureSelection获取被选中的要素
- 关于从Map.FeatureSelection获得selection不能读到Feature的其他属性问题
- 获取对象的接口信息(方法/属性/事件)(VB6代码)
- 获取对象的接口信息(方法/属性/事件)(VB6代码)
- 移动端Skyline获取Feature图层属性的
- 图像属性信息的获取
- 图像属性信息的获取
- 获取照片的属性信息
- 获取照片的属性信息
- feature的属性和函数
- 通过反射获取构造方法,属性,方法信息
- Request的RawUrl属性,和其它获取url信息的各种方法比较(转)
- REQUEST的RAWURL属性,和其它获取URL信息的各种方法比较
- Request的RawUrl属性,和其它获取url信息的各种方法比较
- 如何获取GDI对象的属性信息
- 三、获取文件的属性信息
- Silverlight菜单控件 — CurveMenu
- 经典书籍
- 帮忙看一下这个程序,为什么在调式时候调不出来
- java简单除法小程序
- Silverlight 3.0 中的 WriteableBitmap
- IMap.FeatureSelection方法获取Feature的属性信息
- Struts1.x 防止用户重复提交表单
- 零~~~
- Google出的新玩意 只能说未来已经到了~
- 构建基于MVC+Observer模式的、艺术性的移动开发框架(KJAVA版)(二)
- F#探险之旅(一):选择不同的开发方式
- 数据仓库建设
- 多线程实时数据采集MFC VISUAL C++ /C++
- 关于MAPGIS-IMS java工程出图时候出现COperResult : COperResult异常的处理