[gdal-dev] GDAL precision for Geometry object

Hermann Peifer peifer at gmx.eu
Sat Oct 10 09:07:09 PDT 2015


On 2015-10-10 17:56, Hermann Peifer wrote:
> On 2015-10-10 14:06, Even Rouault wrote:
>>
>> The implementation of ExportToWKT() in GDAL uses 15 decimal figures
>> ("%.15f"
>> printf formatting) whatever the source precision was, and as you point,
>> whatever the intrinsic precision of the double value is.
>>
>
> Does "%.15f" have any added value over "%.15g" (in the usual real-life
> GIS situations, I mean). I also vaguely remember some posting/ticket
> about "%.15f" versus "%.15g", including a request to partially revert a
> changeset. This was years ago, and I can't find at the moment.
>

The earlier issue was related to some change in the AAIGrid writer, 
http://trac.osgeo.org/gdal/ticket/3732. As hamish (from the GRASS 
community) wrote at the end of the ticket: "I'd point out that for IEEE 
double precision floating point you don't gain anything by going past 
%.17g."

Hermann




More information about the gdal-dev mailing list