Opened 12 years ago

Last modified 12 years ago

#4614 closed defect

Incorrect Rounding from OGRFormatDouble — at Version 1

Reported by: jpalmer Owned by: Even Rouault
Priority: high Milestone: 1.9.1
Component: OGR_SF Version: unspecified
Severity: normal Keywords:
Cc: Robert Coup

Description (last modified by jpalmer)

When exporting a geometry with a vertex value of 169.600374, OGRGeometry.ExportToWkt() gives an incorrect rounded value of 169.60037.

Tracking this down it relates to the logic implemented within OGRFormatDouble() pretty-printing rounding when dealing with trailing 99999s:

http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrutils.cpp#L141

In the default case where nPrecision is set to 15 the float value is incorrectly truncated to 5 DP.

Change History (1)

comment:1 by jpalmer, 12 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.