AnsweredAssumed Answered

Problems with Annotation Feature Class

Question asked by geonetadmin on Jun 3, 2010
Latest reply on Jun 3, 2010 by geonetadmin
Original User: newbyproger

Hello. 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 everytime
2. Is it possible not to use Decimal Degree units in buffer? map units are meters.

Attachments

Outcomes