<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Writing Annotation Features: Performance extremely Slow in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/writing-annotation-features-performance-extremely/m-p/119929#M3115</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;while&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; ((feature = sourceCursor.NextFeature()) != &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;null&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;targetFeatureBuffer = targetFeatureClass.CreateFeatureBuffer();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;foreach&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #2b91af; font-size: small; font-family: Consolas;"&gt;FieldIndices&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; _fldIndex &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; _fldIndices)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;_SrcObj = feature.Value[_fldIndex.SrcI];&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; (_SrcObj != &lt;/SPAN&gt;&lt;SPAN style="color: #2b91af; font-size: small; font-family: Consolas;"&gt;DBNull&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;.Value)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;targetFeatureBuffer.set_Value(_fldIndex.TgtI, _SrcObj);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;else&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; targetFeatureBuffer.set_Value(_fldIndex.TgtI, &lt;/SPAN&gt;&lt;SPAN style="color: #2b91af; font-size: small; font-family: Consolas;"&gt;DBNull&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;.Value);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;_shape = feature.ShapeCopy;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; _shape.Project(spatialReference); &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;//project coordinates&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; targetFeatureBuffer.Shape = (&lt;/SPAN&gt;&lt;SPAN style="color: #2b91af; font-size: small; font-family: Consolas;"&gt;IGeometry&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;)_shape;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;targetCursor.InsertFeature(targetFeatureBuffer);&lt;/P&gt;&lt;P&gt;_noRecsAffected++;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a faster way of writing Annotation features ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Nov 2016 22:14:29 GMT</pubDate>
    <dc:creator>nishadwijesekara</dc:creator>
    <dc:date>2016-11-10T22:14:29Z</dc:date>
    <item>
      <title>Writing Annotation Features: Performance extremely Slow</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/writing-annotation-features-performance-extremely/m-p/119929#M3115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;while&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; ((feature = sourceCursor.NextFeature()) != &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;null&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;targetFeatureBuffer = targetFeatureClass.CreateFeatureBuffer();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;foreach&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #2b91af; font-size: small; font-family: Consolas;"&gt;FieldIndices&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; _fldIndex &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; _fldIndices)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;_SrcObj = feature.Value[_fldIndex.SrcI];&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; (_SrcObj != &lt;/SPAN&gt;&lt;SPAN style="color: #2b91af; font-size: small; font-family: Consolas;"&gt;DBNull&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;.Value)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;targetFeatureBuffer.set_Value(_fldIndex.TgtI, _SrcObj);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;else&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; targetFeatureBuffer.set_Value(_fldIndex.TgtI, &lt;/SPAN&gt;&lt;SPAN style="color: #2b91af; font-size: small; font-family: Consolas;"&gt;DBNull&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;.Value);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;_shape = feature.ShapeCopy;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; _shape.Project(spatialReference); &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;//project coordinates&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; targetFeatureBuffer.Shape = (&lt;/SPAN&gt;&lt;SPAN style="color: #2b91af; font-size: small; font-family: Consolas;"&gt;IGeometry&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;)_shape;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;targetCursor.InsertFeature(targetFeatureBuffer);&lt;/P&gt;&lt;P&gt;_noRecsAffected++;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a faster way of writing Annotation features ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2016 22:14:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/writing-annotation-features-performance-extremely/m-p/119929#M3115</guid>
      <dc:creator>nishadwijesekara</dc:creator>
      <dc:date>2016-11-10T22:14:29Z</dc:date>
    </item>
  </channel>
</rss>

