[Gdal-dev] Problem with reading GXF files?

Frank Warmerdam warmerdam at pobox.com
Wed Oct 20 18:50:17 EDT 2004


Mark Coletti wrote:
> I'm having difficulties reading a GXF file in qgis.  Part of the
> problem seems to be in calculating the minimum and maximum values.
> 
> For example:
> 
> qgsrasterlayer.cpp : 2062 myGdalBand->GetMinimum() failed
> qgsrasterlayer.cpp : 2070 myGdalBand->GetMaximum() failed
> GDALminium:     -4.29497e+09
> GDALmaxium:     4.29497e+09
> 
> By "failed" I mean that the pbSuccess flag was set to zero with each
> of those function calls.  However, the documentation for those
> functions is a bit unclear as to exactly what it means with the
> pbSuccess flag is zero.
> 
> pbSuccess:
>     pointer to a boolean to use to indicate if the returned value
>     is a tight maximum or not. May be NULL (default).
> 
> What is a "tight maximum?"

Mark,

The methods GetMinimum() and GetMaximum() are supposedly guaranteed
to return a minimum value less than or equal to all actual pixels values, and
GetMaximum() gets a value >= all pixel values.

If the format intrinsicly knows the min and max of the pixels these values
are returned, otherwise the min and max for the data type is returned.  So a
tight min/max means they are tightest range for the pixel data.  But if we
can only return the min/max for the data type (ie 0-65535 for UInt16) then
then the success flag is returned FALSe.

It sounds like things are working properly.

You might want to look at GDALComputeRasterMinMax().

   http://www.gdal.org/gdal_8h.html#a144

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list