Ticket #3732 (closed defect: fixed)

Opened 3 years ago

Last modified 9 months ago

Change float format string for AAIGrid writer to %.20g

Reported by: cdestigter Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: asciigrid
Cc:

Description (last modified by cdestigter) (diff)

The AAIGrid float format string is "%6.20g"

Firstly, the 6 doesn't really add anything, and when writing small integers it causes them to be space-padded, which is a waste of bytes.

At present AAIGrid supports "-co DECIMAL_PRECISION=10" which changes the formatstring to "%.10f".

This is a little inconsistent, and the %f causes integers to be written as "9.000000000" which is a horrible waste of bytes.

I'll attach a minimal patch shortly which fixes these.

Attachments

gdal-ascii-grid-floatformat.patch Download (1.0 KB) - added by cdestigter 3 years ago.

Change History

Changed 3 years ago by cdestigter

  • type changed from enhancement to defect
  • description modified (diff)
  • summary changed from Add a FLOAT_FORMAT creation option to ASCII Grid writer to Change float format string for AAIGrid writer to %.20g

Changed 3 years ago by cdestigter

Changed 9 months ago by rcoup

  • status changed from new to closed
  • resolution set to fixed

Fixed in [25032]

Note: See TracTickets for help on using tickets.