Good day,
I'm trying to figure out how to write an SQL query for SpatialQueryFilter in WhereClause, so that when browsing individual elements, it excludes the currently read element from the selection.
private async Task DeletePolygonInPolygon(FeatureLayer polygonLayer)
{
var spatialQuery = new SpatialQueryFilter()
{ SpatialRelationship = SpatialRelationship.Contains };
spatialQuery.WhereClause = "";//Somehow write down to keep it current because it would match
polygonLayer.Select(spatialQuery);
object[] listOfPara = { polygonLayer };
await StartATask("management.DeleteFeatures", listOfPara);
}
Thank you
David
Solved! Go to Solution.
I'm not near a computer to test anything, but from what I can see your going to want to add a for loop to the body of your function. For each feature in the featurelayer you pass into the function return the ObjectID (or other unique id). Then you can use that to exclude the current feature from the WhereClause.
I'm not near a computer to test anything, but from what I can see your going to want to add a for loop to the body of your function. For each feature in the featurelayer you pass into the function return the ObjectID (or other unique id). Then you can use that to exclude the current feature from the WhereClause.