Under ArcMap, I used to be able to create a spatialfilter based on a spatial relationship. For example, if I wanted to find the polygons of a feature that were sharing a border I could do this:
' Create a spatial filter with a share border spatial relationship.
Dim spatialFilter As ISpatialFilter = New SpatialFilterClass()
spatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelRelation
spatialFilter.SpatialRelDescription = "F***T****"
spatialFilter.WhereClause = "CAST(" & EgdPdA.NomChamp.PD_NUM & " AS VARCHAR(3)) || '-' || " & EgdPdA.NomChamp.PD_NBR_SFX & " = '" & pdNumPdNbrSfx & "' AND " & _
EgdPdA.NomChamp.FED_NUM & " = " & sFedNum
' Execute the query.
Dim selectionSet As ISelectionSet
selectionSet = pFwsp.OpenFeatureClass(sLayerName).Select(spatialFilter,esriSelectionType.esriSelectionTypeSnapshot, esriSelectionOption.esriSelectionOptionNormal, Nothing)
I have not been able to find an equivalent under ArcGIS Pro. Do you know how it can be done?
Solved! Go to Solution.
I believe I'll be able to do what I want by using the geoprocessing "management.SelectLayerByLocation"
Have you looked into SpatialQueryFilter? Here are a couple of code snippets using it
Thanks a lot!
That's what I was looking for.