<html><body style="font-family: Helvetica,Arial,sans-serif; font-size: 12px;"><div>Hi List. I'm using GDAL/OGR 1.11 in an Objective-C (iOS) application.</div><div><br></div><div>I'm attempting to store double values in an OFTReal field using OGR_F_SetFieldDouble() and then to retrieve these values later using OGR_F_GetFieldAsDouble(). If I retrieve the value immediately, it works fine. However, after closing and re-opening the datasource/layer, I only ever get zero (0.0) values. I am running syncToDisk() after writing values.</div><div><br></div><div>I'm using the Esri Shapefile driver.</div><div><br></div><div>The code used for writing is:</div><div>-----------------------------------------------------------------------</div><div><span class="Apple-tab-span"> </span>i = OGR_F_GetFieldIndex(feature.feature, "Time");</div><div><span class="Apple-tab-span"> </span>if ( i > -1 ) {</div><div><span class="Apple-tab-span"> </span>OGR_F_SetFieldDouble(feature.feature, i, [[NSDate date] timeIntervalSince1970]);</div><div><span class="Apple-tab-span"> </span>NSLog(@"Wrote %ld Date %f", OGR_F_GetFID(feature.feature), OGR_F_GetFieldAsDouble(feature.feature, i));</div><div><span class="Apple-tab-span"> </span>// LOGS EXPECTED NON-ZERO VALUE HERE</div><div><span class="Apple-tab-span"> </span>}</div><div><br></div><div><span class="Apple-tab-span"> </span>OGR_L_SyncToDisk(_layer);</div><div>-----------------------------------------------------------------------</div><div><br></div><div>The code used for reading after re-opening the data source is:</div><div>-----------------------------------------------------------------------</div><div><span class="Apple-tab-span"> </span>i = OGR_F_GetFieldIndex(_feature, "Time");</div><div><span class="Apple-tab-span"> </span>if ( i > -1 ) {</div><div><span class="Apple-tab-span"> </span>NSLog(@"Got %ld Cell Date: %f", OGR_F_GetFID(_feature), OGR_F_GetFieldAsDouble(_feature, i));</div><div><span class="Apple-tab-span"> </span>// ALWAYS LOGS 0.0 HERE (logs a valid FID)</div><div><span class="Apple-tab-span"> </span>}</div><div>------------------------------------------------------------------------</div><div><br></div><div>Am I doing anything obviously wrong? Any ideas why this is not working as I expected?</div><div><br></div><div>Let me know if there is any more code that would make it more clear.</div></body></html>