IFeatureSelection.SelectFeatures
官方解释:Selects features based upon the specifed criteria and combination method.
译文:根据指定的 标准 和组合方法选择要素。
有人这样解释:已知一个要素图层和我们的选择条件,寻找出符合要求的要素并闪烁显示
指定的标准,即为ISpatialFilter,那我们要考虑ISpatialFilter.Geometry的属性会对结果产生什么影响?
这个Geometry是否应该是合并一整个图层的要素,还是单独来一个一个判定?
如果按照上面的解释,应该是单独判定。
即为:不断改变ISpatialFilter.Geometry,进而改变ISpatialFilter
问题:对esriSpatialRelEnum的理解有问题
esriSpatialRelWithin Description: Query Geometry is Within Target Geometry.
译文:within 查询 包含在目标Geometry内的Geometry。
Remarks:Returns a feature if its shape wholly contains the search geometry. Valid for all shape type combinations .
译文:返回一个要素,它的形状包含了这个搜索使用的Geometry。
这里Description与Remarks产生了分歧,或者我的理解出了问题。
但测试结果符合Remarks的解释。
由以上 代码 可以看出:Within查询的是包含SpatialFilter.Geometry的Geometry。
这也就意味着,如果你用 AE 来写ArcMap中的空间查找,其中的
contain the source layer feature 即:目标要素包含源图层要素选项
对应的过滤关系为
pSpatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelWithin;
are within the source layer feature 即:目标要素被源图层要素包含选项
对应的过滤关系为
pSpatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelContains;
注意contain对应的Within、within对应的Contains
免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删