<div dir="ltr"><div>Hi,</div><div><br></div><div>- try adding the following line:</div><div>outlayer->SetFeature(outfeature); </div><div><br></div><div>after:</div><div>outfeature->SetField("production", FALL->Production);</div>
<div><br></div><div>ends up being:</div><div>[...]</div><div>outfeature->SetField("production", FALL->Production);</div><div>outlayer->SetFeature(outfeature); </div><div>[...]</div><div><br></div><div><span style="font-size:13px;font-family:arial,sans-serif">make sure OGRDataSource::</span><span style="font-size:13px;font-family:arial,sans-serif">DestroyDataSource(outsource) is executed</span></div>
<div><span style="font-size:13px;font-family:arial,sans-serif">(it "</span><span style="color:rgb(0,0,0);font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;font-size:12px;background-color:rgb(251,252,253)">will ensure all data is correctly flushed."</span><span style="font-family:arial,sans-serif;font-size:13px">)</span></div>
<div><span style="font-size:13px;font-family:arial,sans-serif"><br></span></div><div><br></div><div>- You may, also, want to check the following line:</div><div>prfield.SetWidth(32);</div><div><br></div><div>try with SetPrecision instead (since you are adding a OFTReal field):</div>
<div>prfield.SetPrecision(32);</div><div><br></div><div><br></div><div>- you could try with outlayer->GetFeatureCount(TRUE)</div><div>(check the doc at <a href="http://www.gdal.org/classOGRLayer.html">http://www.gdal.org/classOGRLayer.html</a>)</div>
<div><br></div><div><br></div><div><br></div><div>Hope it helps.</div><div><br></div><div>Regards,</div><div>Daniel.</div></div>