OGR shapefile driver, field numerical scientific notation
|Reported by:||rsbivand||Owned by:||warmerdam|
|Severity:||normal||Keywords:||OGR Shapefile write|
Recent ESRI shapefiles apparently write very small floating point numbers in "e" format, which can be read but not be written with shapelib or the ESRI shapefile driver. A possible resolution may be to edit lines 1347-8 in:
sprintf( szFormat, "%%%d.%df",
nWidth, psDBF->panFieldDecimals[iField] );
to accommodate a possible scientific notation. The attached shapefile is seeded with 9.87654e-24 in reg_flt, and reads fine, but when writing the same file out, the DBF file gets "0.000000000000000" rather than the ESRI DBF, which has "9.87654e-024". I realise that ESRI are probably stretching what may be put into a DBF, but if they are doing this, it might be reasonable to do the same.