<?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: Get Previous Feature Using FeatureCursor in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-previous-feature-using-featurecursor/m-p/281196#M7263</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Neil,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's good to know. I've added a QueryFilterDefinition.PostfixClause to fix this issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Corbin de Bruin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Nov 2013 14:08:31 GMT</pubDate>
    <dc:creator>Corbinde_Bruin</dc:creator>
    <dc:date>2013-11-07T14:08:31Z</dc:date>
    <item>
      <title>Get Previous Feature Using FeatureCursor</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-previous-feature-using-featurecursor/m-p/281191#M7258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is the best practice for stepping backwards in a FeatureCursor. I use the NextFeature() method to loop through a FeatureCursor and make edits, but now I need tot be able to scroll back and forth between features in a FeatureCursor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If there is another way, I do not need to use the FeatureCursor. I just don't know of another way.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I looked into using an enumerator, but that looks like it has the same exact problem. I see a Next() method and a Reset() method, but no Previous() method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I feel I am missing something basic here. Right now I am requerying the database every time I want to access a 'previous' feature. I'd love to see some ArcObjects best practices here. I've searched the documentation and forums, but I was unable to find anything related.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Corbin de Bruin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 13:58:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-previous-feature-using-featurecursor/m-p/281191#M7258</guid>
      <dc:creator>Corbinde_Bruin</dc:creator>
      <dc:date>2013-11-06T13:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Get Previous Feature Using FeatureCursor</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-previous-feature-using-featurecursor/m-p/281192#M7259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could put the features into a collection (an array, dictionary, hashtable, etc). After running the feature cursor once to build the collection, you can access the features as you need.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One of my projects involved doing a series of calculations on the attributes of a group of features. Many of the calculations used values that were the result of previous calculations. The person who originally wrote the code used a separate cursor for each individual calculation, which took forever. I was able to rewrite the code where all of the attributes for the features where written into an array using a featurecursor. All the calculations where then done by looping through this array, which speed things up immensely.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 14:22:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-previous-feature-using-featurecursor/m-p/281192#M7259</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2013-11-06T14:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Get Previous Feature Using FeatureCursor</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-previous-feature-using-featurecursor/m-p/281193#M7260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Writing to an array is another method I had toyed around with, and it's what I have moved to using today.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you use Array.FindIndex at all? This is what I would up using to loop through my records and find the previous record.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;gRow = Array.FindLastIndex(rowArray, AddressOf previousPhotoRowPredicate)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; Private Function previousPhotoRowPredicate(ByVal pRow As Row) As Boolean

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If pRow.OID &amp;lt; gCurrentRow.OID Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return True
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return False
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Function&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:38:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-previous-feature-using-featurecursor/m-p/281193#M7260</guid>
      <dc:creator>Corbinde_Bruin</dc:creator>
      <dc:date>2021-12-11T13:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Get Previous Feature Using FeatureCursor</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-previous-feature-using-featurecursor/m-p/281194#M7261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I didn't need to look for particular feature, so I never played around with Array.FindIndex&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 18:52:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-previous-feature-using-featurecursor/m-p/281194#M7261</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2013-11-06T18:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: Get Previous Feature Using FeatureCursor</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-previous-feature-using-featurecursor/m-p/281195#M7262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Unless you're using an ORDER BY clause in the query or doing something else to sort the results, the features in a feature cursor will not be in any reliable order.&amp;nbsp; For example, if the ObjectId of the current feature is 2 you can't assume that the ObjectId of the previous feature was 1.&amp;nbsp; This may or may not apply to your specific scenario but I just wanted to point it out in case it does matter.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 19:54:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-previous-feature-using-featurecursor/m-p/281195#M7262</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2013-11-06T19:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Get Previous Feature Using FeatureCursor</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-previous-feature-using-featurecursor/m-p/281196#M7263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Neil,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's good to know. I've added a QueryFilterDefinition.PostfixClause to fix this issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Corbin de Bruin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 14:08:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-previous-feature-using-featurecursor/m-p/281196#M7263</guid>
      <dc:creator>Corbinde_Bruin</dc:creator>
      <dc:date>2013-11-07T14:08:31Z</dc:date>
    </item>
  </channel>
</rss>

