I'm writing a tool to delete and write features into feature classes (from a File Geodatabase into a Geodatabase). I have optimized the code which works fast with tables and feature classes. Just found out that it is fairly slow writing records into Annotaion FeatureClass, which I think is because of writing Blob values into Element field.
while ((feature = sourceCursor.NextFeature()) != null)
{
targetFeatureBuffer = targetFeatureClass.CreateFeatureBuffer();
foreach (FieldIndices _fldIndex in _fldIndices)
{
_SrcObj = feature.Value[_fldIndex.SrcI];
if (_SrcObj != DBNull.Value)
{
targetFeatureBuffer.set_Value(_fldIndex.TgtI, _SrcObj);
}
else
targetFeatureBuffer.set_Value(_fldIndex.TgtI, DBNull.Value);
}
_shape = feature.ShapeCopy;
_shape.Project(spatialReference); //project coordinates
targetFeatureBuffer.Shape = (IGeometry)_shape;
targetCursor.InsertFeature(targetFeatureBuffer);
_noRecsAffected++;
}
Is there a faster way of writing Annotation features ?