SpatialRelationshipDescription Property
The DE-9IM matrix relation encoded as a string. This property is only applicable if the SpatialRelationship is
SpatialRelationship.Relation.
Spatial query filter with DE9-IM spatial relationships
public void FindSpatiallyRelatedFeaturesUsingDE9IMPredicate(Geodatabase geodatabase, FeatureClass polygonFeatureClass, FeatureClass polylineFeatureClass)
{
using (RowCursor polygonRowCursor = polygonFeatureClass.Search(new QueryFilter()))
{
if (polygonRowCursor.MoveNext())
{
using (Feature polygonFeature = polygonRowCursor.Current as Feature)
{
// DE9IM predicate string to find overlapping features
string overlappingDE9IM = "1*T***T**";
SpatialQueryFilter spatialQueryFilter = new SpatialQueryFilter()
{
FilterGeometry = polygonFeature.GetShape(),
SpatialRelationship = SpatialRelationship.Relation,
SpatialRelationshipDescription = overlappingDE9IM
};
using (RowCursor overlappingPolyline = polylineFeatureClass.Search(spatialQueryFilter))
{
while (overlappingPolyline.MoveNext())
{
// Overlapping polylines on the polygon
}
}
}
}
}
}
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3.1 or higher.