I am working with some feature classes. I create those feature classes using my add-in. User can add/ delete features from these feature classes clicking on "add", "delete" buttons and selecting features. I added features using following code:
void AddFeature(IFeatureClass featureClass, IGeometry geometry)
{
IFeature feature = featureClass.CreateFeature();
feature.Shape = geometry;
feature.Store();
}
And deleted features using following code:
void DeleteFeaturesWithinPolygon(IFeatureClass featureClass, IPolygon polygon)
{
List<IFeature> features = GetFeaturesWithinPolygon(featureClass, polygon);
foreach (var feature in features)
feature.Delete();
}
Thing is, I did not use editor session. And actually, I did not think about it earlier. but today seeing this question, I think about edit session. I know can do these edits, without edit session. Actually I am doing it right now.
IEditor
, I feel that most amazing thing of this is decreasing significant amount of time. When I updated 13k features, time reduces from 20 minutes to 1 minute.