<?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 Re: Process IFeatureCursor results many times without re-applying query/filter in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/process-ifeaturecursor-results-many-times-without/m-p/377903#M9991</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Rob,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Move the line that creates the spatialfilter object out of your looping code and place it above, you only need to create this object once.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So move these line above the beginning of your loop&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ISpatialFilter SPF = new SpatialFilter();
SPF.SpatialRel = esriSpatialRelEnum.esriSpatialRelWithin;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 17:26:52 GMT</pubDate>
    <dc:creator>DuncanHornby</dc:creator>
    <dc:date>2021-12-11T17:26:52Z</dc:date>
    <item>
      <title>Process IFeatureCursor results many times without re-applying query/filter</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/process-ifeaturecursor-results-many-times-without/m-p/377901#M9989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a spatial filter performing as I want it to, returning me an IFeatureCursor object that I can loop through. I want to be able to loop through the IFeatureCursor object more than once without re-applying the filter, the spatial filtering can take some time to apply in large data sets. Is there a method available for this, like 'IFeature.FirstFeature()' rather than having to re-apply the filter and start wiith 'IFeature.NextFeature()' again? Code below.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Dictionary&amp;lt;int, Dictionary&amp;lt;int, string&amp;gt;&amp;gt; FIDs = new Dictionary&amp;lt;int, Dictionary&amp;lt;int, string&amp;gt;&amp;gt;();
while ((pFeat = pFeatCursor.NextFeature()) != null)
{
 int thisFID = (int)pFeat.Value[fidIdx];
 FIDs.Add(thisFID, new Dictionary&amp;lt;int, string&amp;gt;());


 ISpatialFilter SPF = new SpatialFilter();
 SPF.SpatialRel = esriSpatialRelEnum.esriSpatialRelWithin;
 SPF.Geometry = pFeat.ShapeCopy;


 IFeatureCursor IFC2 = resultFeatLay.Search(SPF, false);
 IFeature IF2;

 int theCount = 1;
 while ((IF2 = IFC2.NextFeature()) != null)
 {
&amp;nbsp; FIDs[thisFID].Add((int)IF2.Value[fidIdx], (string)IF2.Value[splitIdx]);
&amp;nbsp; theCount += 1;
 }

 //THIS IS MY ATTEMPT AT STARTING THE LOOP AGAIN, TO NO AVAIL
 while ((IF2 = IFC2.NextFeature()) != null)
 {
&amp;nbsp; string stophere = "";
 }

}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 May 2013 01:26:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/process-ifeaturecursor-results-many-times-without/m-p/377901#M9989</guid>
      <dc:creator>RobEllis</dc:creator>
      <dc:date>2013-05-08T01:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: Process IFeatureCursor results many times without re-applying query/filter</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/process-ifeaturecursor-results-many-times-without/m-p/377902#M9990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; Is there a method available for this, like 'IFeature.FirstFeature()'...&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#Cursors"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#Cursors&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;&lt;STRONG&gt;Cursors and selection sets&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Cursors provide a way to sequentially step through a series of records. The following are the types of class cursors:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Search cursors&lt;/STRONG&gt;�??Inspect and edit rows.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Update cursors&lt;/STRONG&gt;�??Edit and delete rows.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Insert cursors&lt;/STRONG&gt;�??Add new rows to the table.&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; To determine whether to use a search cursor or an update cursor during editing, see &lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/0001/0001000002rs000000.htm"&gt;Updating features&lt;/A&gt;. Cursors can be created from many interfaces, including ITable, IFeatureClass, &lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/d/002500000801000000.htm"&gt;ISelectionSet&lt;/A&gt;, and &lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/d/00250000069q000000.htm"&gt;IQueryDef&lt;/A&gt;.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Cursors allow records to be iterated through only once, in&amp;nbsp; one direction. &lt;SPAN style="color: #b22222; text-decoration: underline;"&gt;They do not support behavior such as, resetting, moving&amp;nbsp; backwards, or making multiple passes (create cursors to make multiple&amp;nbsp; passes).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 May 2013 13:27:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/process-ifeaturecursor-results-many-times-without/m-p/377902#M9990</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2013-05-08T13:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Process IFeatureCursor results many times without re-applying query/filter</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/process-ifeaturecursor-results-many-times-without/m-p/377903#M9991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Rob,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Move the line that creates the spatialfilter object out of your looping code and place it above, you only need to create this object once.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So move these line above the beginning of your loop&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ISpatialFilter SPF = new SpatialFilter();
SPF.SpatialRel = esriSpatialRelEnum.esriSpatialRelWithin;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:26:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/process-ifeaturecursor-results-many-times-without/m-p/377903#M9991</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-12-11T17:26:52Z</dc:date>
    </item>
  </channel>
</rss>

