ldonahue

Deleting Selected Features

Discussion created by ldonahue on Jan 19, 2012
Latest reply on Jan 24, 2012 by twhiteaker
What is the best option to delete simple features from a shapefile progammatically after a user selects them randomly from the map?

If I use a QueryFilter and IFeatureCursor to delete the selected features, then I would need to have a where clause that knows the OBJECTID of all the selected features.  No problem creating a where clause but this would seem like a rather long where clause at times.

I can also assign the feature layer selection set IDs to an IEnumIDs and then iterate over that and simply do something like:
featureClass.getFeature(featureLayer.getSelectionSet().getIDs().next()).delete();

Is there a better alternative?

Outcomes