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

Vincent Schut schut at sarvision.com
Thu Nov 11 03:28:27 EST 2004


Frank Warmerdam wrote:
> 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.
> 
You're right, it is more complicated than I thought. Indeed in grass a 
category can belong to a range of values, too. Thanks for looking into 
this, anyway.

Vincent.

> 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,




More information about the Gdal-dev mailing list