1、Search方法的区别
查看IfeatureLayer的Search方法的帮助,如下:
If there is a definition query set on the layer, theSearchmethod will work on the subset of features in the layer that meet the definition criteria. Otherwise, it will search theFeatureClassassociated with the layer.
ThisSearchmethod will not work on joined fields. If theFeaureLayerhas any joins, you should use theIGeoFeatureLayer::SeachDisplayFeaturesmethod instead.
值得注意的是,如果图层没有设置definition query ,那么两者的结果没有差别,但是如果图层设置了definition query ,那么就有差别了,呵呵。
参考:http://www.gisall.com/?uid-5999-action-viewspace-itemid-75
2、FeatureCount
featureLayer.FeatureClass.FeatureCount获得记录数永远是一个table所有记录数,所以一定要注意
本文详细对比了GIS中IFeatureLayer的Search方法与IGeoFeatureLayer::SearchDisplayFeatures方法的区别,尤其关注于定义查询(definition query)设置与否对搜索结果的影响。此外,还讨论了FeatureCount属性的正确使用方式。
1527

被折叠的 条评论
为什么被折叠?



