AnsweredAssumed Answered

search cursor - spatialfilter - query for multipart polygon - arc 10 desktop

Question asked by t_joseph833 on Apr 3, 2012
Latest reply on Apr 4, 2012 by Neil
Does anyone know why multipart polygon doesn't work with this??

            pGridGeom = pGridFeature.Shape
            pGridSpatialFilter = New SpatialFilterClass
            With pGridSpatialFilter
                .GeometryField = pFeatcls.ShapeFieldName
                ' .SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects
                .SpatialRel = esriSpatialRelEnum.esriSpatialRelWithin
                .Geometry = pGridGeom
            End With
            pCursor = pFeatcls.Search(pGridSpatialFilter, True)

Should we 'explode' multipart poly into geometries?? Tried this but doesn't work ...

                If pGeomColl.GeometryCount > 1 Then
                    For i As Integer = 0 To pGeomColl.GeometryCount - 1
                        Dim pPolygonNew As IPolygon
                        Dim NewGeometryArray(0) As IGeometry
                        NewGeometryArray(0) = pGeomColl.Geometry(i)
                        Dim gBridge As IGeometryBridge = New GeometryEnvironment()
                        gBridge.AddGeometries(pPolygonNew, NewGeometryArray)
                        pGridGeom = pPolygonNew
                    Next
                 endif

Any help or suggestions?? Cheers.

Outcomes