Opened 9 years ago

Closed 6 years ago

#4256 closed defect (wontfix)

gdal_rasterize does not update statistics given by gdalinfo -stats

Reported by: janh Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

When burning new values into raster bands with "gdal_rasterize", the statistics given by "gdalinfo -stats" are not updated. Attached a tif-file with all zeros burned into all four bands that gives the original values with gdalinfo -stats

Attachments (1)

test.tif (398.1 KB) - added by janh 9 years ago.

Download all attachments as: .zip

Change History (2)

Changed 9 years ago by janh

Attachment: test.tif added

comment:1 Changed 6 years ago by Jukka Rahkonen

Resolution: wontfix
Status: newclosed

You are right. Gdal_rasterize does not care about statistics and gdalinfo -stats does not recompute statistics if they are already stored into file.

It is possible to remove the old statistics by running gdal_edit.py with -unsetstats option http://www.gdal.org/gdal_edit.html

Situation is not optimal because normal GDAL user can't know to be aware of possibly wrong statistics, and it odd that statistics can be created with one tool but for updating the statistics another tool must be used first for wiping the old statistics.

I am still closing the ticket as wontfix because I think that updating the statistics does not especially belong for gdal_rasterize.

BTW the attached image test.tif must be some wrong image, it is not all zeros for all the bands.

Note: See TracTickets for help on using tickets.