Bruce,<br><br>The GetFeatureCount function gets the value with an SQL query to the data server. The bottleneck may be at the connection.<br><br><div class="gmail_quote">On Wed, Oct 14, 2009 at 9:28 PM, Clay, Bruce <span dir="ltr">&lt;<a href="mailto:bclay@ball.com">bclay@ball.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">








<div link="blue" vlink="purple" lang="EN-US">

<div>

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">I have tried several different arrangements trying to get
the feature count from a user selection and I am getting a delay two times for
each query.</span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">My current arrangement is</span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">OGRLayer *queryLayer =
dataSource-&gt;ExecuteSQL(fullQueryString, NULL, <font color="#a31515"><span style="color: rgb(163, 21, 21);">&quot;generic&quot;</span></font>);</span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal" style=""><font color="blue" size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">if</span></font><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> (queryLayer != NULL)</span></font></p>


<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">{</span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">      queryLayer-&gt;ResetReading();</span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">      OGRFeature *feature =
queryLayer-&gt;GetNextFeature();</span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">      <font color="blue"><span style="color: blue;">int</span></font> numFeatures =
queryLayer-&gt;GetFeatureCount();</span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">. . .Display progress meter
then loop reading the features from Oracle</span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">I have tried putting the
call to GetFeatureCount first and there is no apparent difference.</span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">I am reading data from an
Oracle database and using GDAL version 1.6.2 on Windows XP</span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">The call to ExecuteSql returns
right away but the call to the first GetNextFeature and the call to
GetFeatureCount both have a long delay depending on the size of the dataset.</span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">I need the feature count to use
in a progress popup window to let the user know what is happening.</span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">Is there a way to only pay
for the query time once and still get the feature count?</span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Bruce</span></font></p>

</div>

</div>




<pre>This message and any enclosures are intended only for the addressee.  Please  
notify the sender by email if you are not the intended recipient.  If you are  
not the intended recipient, you may not use, copy, disclose, or distribute this  
message or its contents or enclosures to any other person and any such actions  
may be unlawful.  Ball reserves the right to monitor and review all messages  
and enclosures sent to or from this email address.</pre>
<br>_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br>