[GRASS5] r.in.gdal updates?

Frank Warmerdam warmerdam at pobox.com
Fri Feb 28 17:12:01 EST 2003

Glynn Clements wrote:
> Markus Neteler wrote:
>>I would like to ask if a developer is willing to update r.in.gdal
>>(Frank Warmerdam told me that he won't do that at time):
>> - fix the grey color tables issue for RGB maps
> The main problem here is determining the overall range of the data,
> i.e. which values correspond to black and white. Black is almost
> certain to be 0, but determining white is more difficult. Usually it's
> ((1<<bit_depth)-1), but you need to know what bit_depth is.
> Once that's been determined, generating the colour table is trivial.
> NB: this is why d.rgb, r.composite etc need the grey-scale colour
> tables; so that they can translate a cell value to an intensity.


After completing the raster import, the GRASS library will have min/max
information won't it, using the G_get_fp_range_min_max()?

If that isn't practical, the GDALComputeRasterMinMax() function could be
used.  In some cases it is optimized to use range info in the source file

void CPL_DLL GDALComputeRasterMinMax( GDALRasterBandH hBand, int bApproxOK,
                                       double adfMinMax[2] );


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 grass-dev mailing list