<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="country-region"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
pre
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'>Chaitany:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'>Thanks for your reply.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'>&nbsp; I would expect to get one delay due to the
connection time but I did not expect one for both the GetFeatureCount and the
GetNextFeature.&nbsp; Both of those calls are on the same layer variable.&nbsp;
I originally had the GetFeatureCount before the ResetReading.&nbsp; That gave
the same delay. As it turned out the code show below actually had 3
delays.&nbsp; One for the GetNextFeature outside the loop, one for the GetFeatureCount
and another one for the first encounter of the GetNextFeature at the bottom of
the loop.&nbsp; Apparently the GetFeatureCount is leaving the feature pointer
at the bottom of the loop and we have to take time to move back to the top.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'>I would step into the code but I can&#8217;t get Visual
Studio to dig down into gdal16.dll for some reason even though it was built as
a debug library.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Bruce<o:p></o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Chaitanya kumar
CH [mailto:chaitanya.ch@gmail.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, October 14, 2009
2:34 PM<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">Clay,
 Bruce</st1:PersonName><br>
<b><span style='font-weight:bold'>Cc:</span></b> gdal-dev@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [gdal-dev] double
delay getting feature count</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Bruce,<br>
<br>
The GetFeatureCount function gets the value with an SQL query to the data
server. The bottleneck may be at the connection.<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>On Wed, Oct 14, 2009 at 9:28 PM, <st1:PersonName w:st="on">Clay, Bruce</st1:PersonName>
&lt;<a href="mailto:bclay@ball.com">bclay@ball.com</a>&gt; wrote:<o:p></o:p></span></font></p>

<div link=blue vlink=purple>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face=Arial><span style='font-size:10.0pt;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><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>My current
arrangement is</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>OGRLayer
*queryLayer = dataSource-&gt;ExecuteSQL(fullQueryString, NULL, <font
color="#a31515"><span style='color:#A31515'>&quot;generic&quot;</span></font>);</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=blue face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:blue'>if</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> (queryLayer != NULL)</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>{</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
queryLayer-&gt;ResetReading();</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
OGRFeature *feature = queryLayer-&gt;GetNextFeature();</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color=blue><span style='color:blue'>int</span></font> numFeatures =
queryLayer-&gt;GetFeatureCount();</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>.
. .Display progress meter then loop reading the features from Oracle</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>I
have tried putting the call to GetFeatureCount first and there is no apparent
difference.</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>I
am reading data from an Oracle database and using GDAL version 1.6.2 on Windows
XP</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>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><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>I
need the feature count to use in a progress popup window to let the user know
what is happening.</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>Is
there a way to only pay for the query time once and still get the feature
count?</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Bruce</span></font><o:p></o:p></p>

</div>

</div>

<pre><font size=2 face="Courier New"><span style='font-size:10.0pt'>This message and any enclosures are intended only for the addressee.&nbsp; Please&nbsp; <o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>notify the sender by email if you are not the intended recipient.&nbsp; If you are&nbsp; <o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>not the intended recipient, you may not use, copy, disclose, or distribute this&nbsp; <o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>message or its contents or enclosures to any other person and any such actions&nbsp; <o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>may be unlawful.&nbsp; Ball reserves the right to monitor and review all messages&nbsp; <o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>and enclosures sent to or from this email address.<o:p></o:p></span></font></pre>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><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><o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br clear=all>
<br>
-- <br>
Best regards,<br>
Chaitanya kumar <st1:country-region w:st="on"><st1:place w:st="on">CH.</st1:place></st1:country-region><o:p></o:p></span></font></p>

</div>

</body>

</html>


<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>