<?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: Is there a simple way to count number of features returned by IMapServer3 object in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/is-there-a-simple-way-to-count-number-of-features/m-p/448742#M12173</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ken, I'll give that a try!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Apr 2020 15:58:07 GMT</pubDate>
    <dc:creator>chrisweaves</dc:creator>
    <dc:date>2020-04-09T15:58:07Z</dc:date>
    <item>
      <title>Is there a simple way to count number of features returned by IMapServer3 object</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/is-there-a-simple-way-to-count-number-of-features/m-p/448740#M12171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using the arcobjects SDK (10.7.1) I am simply trying to count the number of features returned by a feature service query, here is some sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; IMapServer3 ms = (IMapServer3) this.mapServerDataAccess;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; // query for relevant features using spatial filter&lt;BR /&gt;&amp;nbsp; &amp;nbsp; QueryResult queryResult = (QueryResult) ms.queryData(mapName,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getTableDescription(mapServerInfo, layerId),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; spatialFilter, qResultOptions);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; RecordSet rs = (RecordSet) queryResult.getObject();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can count the number of features returned by getting a cursor and iterating through the cursor items incrementing a counter along the way but this is extremely slow and when working with layers with 2+ million points this is not feasable.&amp;nbsp; Is there a way of getting the count of the number of features in the returned RecordSet?&amp;nbsp; I couldn't see anything obvious.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2020 09:21:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/is-there-a-simple-way-to-count-number-of-features/m-p/448740#M12171</guid>
      <dc:creator>chrisweaves</dc:creator>
      <dc:date>2020-04-07T09:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a simple way to count number of features returned by IMapServer3 object</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/is-there-a-simple-way-to-count-number-of-features/m-p/448741#M12172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you use a &lt;A href="https://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#IRecordSet2.htm"&gt;IRecordSet2&lt;/A&gt; class, it has the Table property. You should be able to use the ITable's RowCount method.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2020 18:32:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/is-there-a-simple-way-to-count-number-of-features/m-p/448741#M12172</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2020-04-07T18:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a simple way to count number of features returned by IMapServer3 object</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/is-there-a-simple-way-to-count-number-of-features/m-p/448742#M12173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ken, I'll give that a try!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2020 15:58:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/is-there-a-simple-way-to-count-number-of-features/m-p/448742#M12173</guid>
      <dc:creator>chrisweaves</dc:creator>
      <dc:date>2020-04-09T15:58:07Z</dc:date>
    </item>
  </channel>
</rss>

