Opened 6 years ago

Last modified 5 months ago

#4857 new defect

GDALGetRasterStatistics() ignores bApproxOK=false bForce=false

Reported by: rblazek Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: statistics
Cc:

Description

If GDALGetRasterStatistics() is called with bApproxOK=false and bForce=false and exact statistics (from all raster pixels) are not available/cached, it should return CE_Warning. Instead, it is giving estimated (from sample) cached statistics and it returns CE_None.

Thus it is not possible to test only if exact statistics are cached to avoid GDALComputeRasterStatistics() if possible.

Change History (3)

comment:1 Changed 6 years ago by warmerdam

Keywords: statistics added
Frank writes:
> I gather the problem is that GDAL cannot tell whether saved statistics in
> metadata are exact or not, right?

Radim writes:
> It should be possible, at least .aux.html has <Approximate>1</Approximate>.

comment:2 Changed 6 years ago by rblazek

Sorry, I was wrong, <Approximate>1</Approximate> is in <Histograms><HistItem> not in <Metadata>.

Note: See TracTickets for help on using tickets.