I have two feature layers. The first one is just a polygon and the other one consists of a series of polygons which are enclosed by the first one. Thus, some polygons of the second feature layer touch on the boundaries of the first feauture layer.
Dim pBlockBoundaryFC As IFeatureClass Set pBlockBoundaryFC = pBlockBoundary.FeatureClass Dim pBlockBoundaryFields As IFields Set pBlockBoundaryFields = pBlockBoundaryFC.Fields ' Create Spatialfilter Dim pGeom As IGeometry Dim pSpatialFilter As ISpatialFilter Set pSpatialFilter = New SpatialFilter ' Create a cursor over all BlockBoundary Dim pBlockBoundaryCursor As IFeatureCursor Set pBlockBoundaryCursor = pBlockBoundaryFC.Search(Nothing, False) ' Main BlockBoundary loop Set pBlockBoundaryFeature = pBlockBoundaryCursor.NextFeature Do Until pBlockBoundaryFeature Is Nothing ' Get block boundary polygon and update spatialfilter Set pGeom = pBlockBoundaryFeature.Shape With pSpatialFilter Set .Geometry = pGeom .GeometryField = "Shape" .SpatialRel = esriSpatialRelTouches End With ' I am assuming you have a NewParcelFC layer set pNewParcelsCursor = pNewParcelFC.Search(pspatialfilter,False) Set pNewParcelsFeature = pNewParcelsCursor.NextFeature Do Until pNewParcelsFeature Is Nothing FID = pNewParcelsFeature.Value(intposFID) MsgBox FID Set pNewParcelsFeature = pNewParcelsCursor.NextFeature loop ' Get next Block boundary Set pBlockBoundaryFeature = pBlockBoundaryCursor.NextFeature Loop
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.