Opened 12 years ago

Last modified 12 years ago

#4614 closed defect

Incorrect Rounding from OGRFormatDouble — at Initial Version

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

When exporting a geometry with a vertex value of 169.600374 OGRGeometry.ExportToWkt() gives gives a a 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 (0)

Note: See TracTickets for help on using tickets.