[Gdal-dev] ENVI and raster attributes/color support

Frank Warmerdam warmerdam at pobox.com
Wed Nov 10 11:47:08 EST 2004


Vincent Schut wrote:
> Dear Frank, Markus, others,
> 
> would it be possible to implement GetCategoryNames() support for a 
> grass57rasterband? I think it might be relatively easy, as grass already 
> supports this using G_read_cats function (see 
> http://mpa.itc.it/markus/grass50progman/node136.html), but I'm not very 
> good in C...
> Though there's limited client support for this feature, I hope to be 
> able to use it from my own Python scripts.

Vincent,

Looking at the Categories structure, it seems that you need to pass the pixel
values through some scaling mechanism in order to get an index into the list
of category labels.  There is also a bunch of stuff about a Quant_table that
looks like each category may actually have ranges.

The simplistic approach to categories in GDAL is based on the assumption that
the list of categories is indexed into by integer pixel values without any
further transformation.

Therefore, I am not sure that it makes sense to directly map category names
from GRASS to GDAL since it would break down in any case where a pixel value
transformation needs to be applied to compute the category index.

Also, does this relate to the color rules that Radim scans with
G_get_f_color_rule() to build the metadata color table?

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