Original User: newbyprogerHello. I have 2 layers: one with polygons, another with text (annotation featuretype). I need to find if there is a label to each polygon. There is a part of code: Dim pPolygonsFCur As IFeatureCursor
Set pPolygonsFCur = pPolygonsFeatClass.Search(Nothing, 1)
Dim pPolygonFeat As IFeature
Set pPolygonFeat = pPolygonsFCur.NextFeature
Dim pTopoOperator As ITopologicalOperator
Set pTopoOperator = New Polygon
Dim pSpatialFilter As ISpatialFilter
Set pSpatialFilter = New SpatialFilter
pSpatialFilter.SpatialRel = esriSpatialRelIntersects
Dim pAnnoFCur As IFeatureCursor
Dim pAnnoFeat As IFeature
Do Until pPolygonFeat Is Nothing
Set pTopoOpeartor = pPolygonFeat.ShapeCopy
Set pSpatialFilter.Geometry = pTopoOperator.Buffer(500)
Set pAnnoFCur = pAnnoFeatClass.Search(pSpatialFilter, 1)
Set pAnnoFeat = pAnnoFCur.NextFeature
Do Until pAnnoFeat Is Nothing
If (pPolygonFeat.Value(iNameIndex) = pAnnoFeat.Value(iTextFieldIndex)) Then
'remember pPolygonFeat.OID
End If
Set pAnnoFeat = pAnnoFCur.NextFeature
Loop
Set pPolygonFeat = pPolygonsFCur.NextFeature
Loop
1. What is wrong? pAnnoFeatClass.Search(pSpatialFilter, 1) doesnt give any result everytime2. Is it possible not to use Decimal Degree units in buffer? map units are meters.