i have to make an intersection between a polygon and a layer of parcels, the polygon used in the clip is not belonging to any layer and the result of this intersection should be all the parcels inside and cuted by the polygon (clip) so i thought to use ITopologicalOperator but i haven't understood how to work with this tool , also it seems to give one feature as result but in my case i need a set of features.

can you give me the right tool to use in Arcobject for my case ?

any advice is welcome :)

thanks in advance

2 Answers 2


Create a spatial filter (ISpatialFilter) with the geometry and get a featurecursor for the layer (using IFeatureclass.Search). Cast the search geometry to ITopologicalOperator and call Intersect on each IFeature.Shape returned by IFeatureCursor.Next().

  • thanks for your help , i was very useful :) , but i'm still stuck with creating new layer in arc objects , i have tried this code it do not work i have a bug in the line with #
    – geogeek
    Sep 10, 2011 at 11:46

thanks for your help , it was very useful :) , but i'm still stuck with creating new layer where i could put the result of the intersection, i have tried this code but it do not work i have a bug in the line with #


'''''''''''''''''''''''''''''''''''' Set pSpatialFilter = New SpatialFilter Set pSpatialFilter.Geometry = pPoly 'the polygone clip pSpatialFilter.SpatialRel = esriSpatialRelContains Set pUpdateCursor = fcpu.Update(pSpatialFilter, False) Set pTopOp = pPoly Set pFeature = pUpdateCursor.NextFeature

Dim geom As IGeometry Dim fe As IFeature

' get the workspace and start editing

Dim fcout As IFeatureClass Dim pNewWSName As IWorkspaceName Dim pFeatClassName As IFeatureClassName Dim pDatasetName As IDatasetName Set pFeatClassName = New FeatureClassName Set pDatasetName = pFeatClassName

Set pNewWSName = New WorkspaceName pNewWSName.WorkspaceFactoryProgID = _ "esriCore.ShapeFileWorkspaceFactory" pNewWSName.PathName = "c:\" Set pDatasetName.WorkspaceName = pNewWSName pDatasetName.Name = "Intersect_result"

Dim pFName As IName Set pFName = pFeatClassName

Set fcout = pFName.Open # ' here it stops Dim pDataset As IDataset Set pDataset = fcout

Dim pWorkspace As IWorkspace Set pWorkspace = pDataset.Workspace

Dim pWorkspaceEdit As IWorkspaceEdit Set pWorkspaceEdit = pWorkspace

pWorkspaceEdit.StartEditing True pWorkspaceEdit.StartEditOperation


Dim pFeat As IFeature Dim pRow As IRow Dim pFlds As IFields Dim lSFld As Long Dim i As Long

Do Until pFeature Is Nothing

'Set fe = New Feature

'Set geom = pTopOp.Intersect(pFeature.Shape, esriGeometry1Dimension)

Set pFeat = fcout.CreateFeature 'fcout.Fields = pFeat.Fields

' Set pFlds = pFeat.Fields ' For i = 0 To pFlds.FieldCount - 1

' lSFld = pFeature.Fields.FindField(pFlds.Field(i).Name)

'    pFeat.Value(i) = pFeature.Value(lSFld)

' Next i

Set pFeat.Shape = pTopOp.Intersect(pFeature.Shape, esriGeometry1Dimension) pFeat.Store Set pFeature = pUpdateCursor.NextFeature Loop pWorkspaceEdit.StopEditOperation pWorkspaceEdit.StopEditing True

  • Please edit the question and add the code there, instead of answering your own question with a new question. Sep 12, 2011 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.