[gdal-dev] poBand->ComputeStatistics() returning different values than ArcMap for .tif file

Peter Halls p.halls at york.ac.uk
Mon Mar 16 14:20:28 PDT 2015


Michael, Evan,

      ArcGIS is dpocumented as not reporting values that do not occur.
In this instance, the minimum values are (R) 60  (G) 230  and (B) 208.
None of these sequences begins at zero, an important factor if
computing the range of values.  I think this behaviour goes back to
the earliest days of raster support (ArcInfo Grid).

      An interesting question is, with these values, why GDAL is
reporting zero for the minimum values.  Unfortunately, I am currently
out of office whils the medics resolve a thyroid problem for me and do
not have a copy of GDAL source to hand.  Maybe there are compromises
in haviig a non-zero minimum value, but negative to positive value
ranges should be supported.

Best wishes,

Peter

On 16 March 2015 at 19:40, Michael Katz - NOAA Affiliate
<michael.katz at noaa.gov> wrote:
> I have a 2GB .tif file. It is 16 bit, and I know the values range from 0 to
> 2047 (i.e., 11 bits are used in the values). It reports three bands, RGB,
> and when I use poBand->ComputeStatistics() on each band I get:
>
> red band (first): min: 0, max: 1953
> green band (second): min: 0, max: 2047
> blue band (third): min: 0, max: 1991
>
> But when I open the same file in ArcMap, get the Layer Properties, look at
> the Symbology tab, set the stretch type to Minimum-Maximum, uncheck Apply
> Gamma Stretch, and click the Histograms button, it shows the following
> values:
>
> Red: min: 60, max: 1547
> Green: min: 230, max: 2047
> Blue: min: 208, max: 1326
>
> It is behaving as if (perhaps) ArcMap is throwing out a certain percentage
> of outlier low and high values when reporting the statistics. But I have
> Minimum-Maximum set as the stretch type, not Percentage Clip, and in any
> event, my understanding is that the chosen stretch type should not affect
> the statistics shown on the Histograms dialog box; that those values are the
> raw values in the file.
>
> Do you have any idea why GDAL would be reporting different min/max values
> for the bands? Any ideas on how I can debug it?
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev



-- 
----------------------------------------------------------------------------------------------------------------
Peter J Halls, PhD Student, Post-war Reconstruction and Development Unit (PRDU)
                     Department of Politics, University of York

Snail mail: PRDU, Derwent College, University of York,
                Heslington, York YO10 5DD
This message has the status of a private and personal communication
----------------------------------------------------------------------------------------------------------------


More information about the gdal-dev mailing list