Jim,<br><br>The layers created with this driver should always have a FID column which is an identity column with primary key constraint. Therefore the else part of the implementation is a bit theoretical and not really used.<br>
<br>Best regards,<br><br>Tamas<br><br><br><br><div class="gmail_quote">2010/9/15 <span dir="ltr"><<a href="mailto:James.Koch@gtri.gatech.edu">James.Koch@gtri.gatech.edu</a>></span><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><pre><span style="font-size: 11pt;">Tamas, thanks for the SQL Server driver. I also did some development on a SQL Server driver for the FalconView software, using OGR's existing MySQL driver as a reference. One issue I saw was with setting a default FID value, when no FID column is present. In OGRMSSQLSpatialLayer::GetNextRawFeature(), you set the value to an incrementing counter:</span></pre>
<pre><span style="font-size: 11pt;"> </span></pre><pre> if( pszFIDColumn != NULL && poStmt->GetColId(pszFIDColumn) > -1 )</pre><pre> poFeature->SetFID( </pre><pre> atoi(poStmt->GetColData(poStmt->GetColId(pszFIDColumn))) );</pre>
<pre> else</pre><pre> poFeature->SetFID( iNextShapeId );</pre><pre><span style="font-size: 11pt;"> </span></pre><pre><span style="font-size: 11pt;">Maybe you addressed this elsewhere in your code, but it seems like this causes problems if you expect the FID value to always be preserved for any given feature. The FID value for a feature will be different before & after a filter is applied to the data set, since new OGRFeature objects are created each time.</span></pre>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Is my understanding of the situation and the driver code
correct? If so, should the FID value stay constant?</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Thanks!</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Jim Koch</p>
<p class="MsoNormal">Georgia Tech Research Institute</p>
<p class="MsoNormal">FalconView Developer</p>
<p class="MsoNormal"><a href="http://www.falconview.org" target="_blank">www.falconview.org</a></p>
<p class="MsoNormal"> </p>
</div>
</div>
<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>