Select to view content in your preferred language

Purging data from feature layers

700
1
07-23-2012 11:26 AM
MikeDuppong
Emerging Contributor
Hello,

What is the best and fastest way to remove all features from a feature layer?

Currently I'm attempting:

FeatureLayer ftrLayer = (get the feature layer from the map)
ftrLayer.RemoveFeatures(map.GetFullExtent(), "1=1");   // also tried "objectid>0"
ftrLayer.SaveEdits(ftrLayer.GetDataTable());


Doesn't seem to cut it.

Also tried ftrLayer.GetDataTable().Clear() with no success.

Dealing with a very large number of features that need deleting (~30,000), so hopefully I don't have to iterate them all; doesn't sound like it would efficient nor quick.

Regards,

Mike
0 Kudos
1 Reply
MikeDuppong
Emerging Contributor
As a follow up, to purge the data, I was successful with:

ftrLayer.CancelAllEdits();
ftrLayer.RemoveFeatures(map.GetFullExtent(), "1=1");
ftrLayer.SaveEdits();
0 Kudos