<?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 cursor slow in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/cursor-slow/m-p/62035#M1704</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to get all features from a feature class and add them to a list.&amp;nbsp; And I have noticed that the iteration using the cursor is just so slow.&amp;nbsp; Does anyone have a better way of getting all values back and populating a list with them.&amp;nbsp; I want the list of all features, but the loop is just so slow.&amp;nbsp; It is taking like 8 seconds to populate the list with 300 features&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;List&amp;lt;IFeature&amp;gt; featureList = new List&amp;lt;IFeature&amp;gt;();&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;//Run the filter on the Feature class and get the intersection&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IFeatureCursor fc = featureClass.Search(null, false);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IFeature feature;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//SLOW PART STARTS HERE&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;while ((feature = fc.NextFeature()) != null)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureList.Add(feature);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Jul 2016 20:23:39 GMT</pubDate>
    <dc:creator>MKa</dc:creator>
    <dc:date>2016-07-08T20:23:39Z</dc:date>
    <item>
      <title>cursor slow</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/cursor-slow/m-p/62035#M1704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to get all features from a feature class and add them to a list.&amp;nbsp; And I have noticed that the iteration using the cursor is just so slow.&amp;nbsp; Does anyone have a better way of getting all values back and populating a list with them.&amp;nbsp; I want the list of all features, but the loop is just so slow.&amp;nbsp; It is taking like 8 seconds to populate the list with 300 features&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;List&amp;lt;IFeature&amp;gt; featureList = new List&amp;lt;IFeature&amp;gt;();&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;//Run the filter on the Feature class and get the intersection&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IFeatureCursor fc = featureClass.Search(null, false);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IFeature feature;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//SLOW PART STARTS HERE&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;while ((feature = fc.NextFeature()) != null)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureList.Add(feature);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2016 20:23:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/cursor-slow/m-p/62035#M1704</guid>
      <dc:creator>MKa</dc:creator>
      <dc:date>2016-07-08T20:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: cursor slow</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/cursor-slow/m-p/62036#M1705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;300 features is small and should be instant; my immediate question is what and where is the source of the data? Is it a shapefile on your C:\ drive or ArcServer on the other side of the planet?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 09:26:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/cursor-slow/m-p/62036#M1705</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2016-07-13T09:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: cursor slow</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/cursor-slow/m-p/62037#M1706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is not the searching that is the issue.&amp;nbsp; That is very quick.&amp;nbsp; It is the Looping through and getting values from each feature in the cursor that is slow.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 13:23:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/cursor-slow/m-p/62037#M1706</guid>
      <dc:creator>MKa</dc:creator>
      <dc:date>2016-07-13T13:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: cursor slow</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/cursor-slow/m-p/62038#M1707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Your searching is fast because you aren't actually searching for anything, i.e., the NULL you are passing will create a cursor with all records.&amp;nbsp; As you iterate through the cursor, the data will be retrieved from the data source, which is why Duncan asked about what and where is the source of data.&amp;nbsp; Also, how many columns are in the data source you are accessing? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 14:01:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/cursor-slow/m-p/62038#M1707</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-07-13T14:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: cursor slow</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/cursor-slow/m-p/62039#M1708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using a file geodatabase located on my local machines hard drive.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also tried to narrow down the columns retrieved, to only the ones I want to retrieve, but it also seems to be slower than I expected.&amp;nbsp; Is there any way to just get all values?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string subfields = "aaaaa, bbbbb, ccccc, ddddd, eeeee";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IQueryFilter queryFilter = new QueryFilterClass();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryFilter.WhereClause = null;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryFilter.SubFields = subfields;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFeatureCursor fc = featureClass.Search(queryFilter, false);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFeature feature;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; List&amp;lt;AllLocalInfoItem&amp;gt; AllLocalInfoItemList = new List&amp;lt;AllLocalInfoItem&amp;gt;();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while ((feature = fc.NextFeature()) != null)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AllLocalInfoItem ali = new AllLocalInfoItem();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ali.aaaaa= xxxxxDbReadWrite.getTableValue(feature, "aaaaa");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ali.bbbbb= xxxxxDbReadWrite.getTableValue(feature, "bbbbb");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ali.ccccc= xxxxxDbReadWrite.getTableValue(feature, "ccccc");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ali.ddddd= xxxxxDbReadWrite.getTableValue(feature, "ddddd");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ali.eeeee= xxxxxDbReadWrite.getTableValue(feature, "eeeee");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AllLocalInfoItemList.Add(ali);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 14:13:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/cursor-slow/m-p/62039#M1708</guid>
      <dc:creator>MKa</dc:creator>
      <dc:date>2016-07-13T14:13:45Z</dc:date>
    </item>
  </channel>
</rss>

