[GRASS-dev] new r.out.gdal fails to preserve 8bit color

Markus Neteler neteler at itc.it
Wed Jan 17 04:21:04 EST 2007


Markus Neteler wrote on 01/17/2007 10:04 AM:
> Moritz Lennert wrote on 01/17/2007 09:23 AM:
>> On 16/01/07 22:14, Markus Neteler wrote:
>>> On Tue, Jan 16, 2007 at 09:53:41PM +0100, Markus Neteler wrote:
>>>> On Tue, Jan 16, 2007 at 07:03:15PM +0100, Maciej Sieczka wrote:
>>>>> Maciej Sieczka wrote:
>>>>>> Vytautas,
>>>>>>
>>>>>> Exporting a CELL GRASS raster, value range 0-255, r.out.gdal 
>>>>>> issues an:
>>>>>>
>>>>>> ERROR 6: SetColorInterpretation() not supported for this dataset.
>>>>>>
>>>>>> and the output map is greyscale.
>>>>> There is a discussion about this defect on the GDAL dev list:
>>>>> http://www.nabble.com/r.out.gdal%3A-SetColorInterpretation%28%29-not-supported-tf3021127.html 
>>>>>
>>>>>
>>>> Probably the mapgdal.c file of MapServer could be an inspiration?
>>>
>>> I found some more:
>>>
>>> http://www.nabble.com/Re:-How-to-set-a-ColorTable-from-scratch--p5000321.html 
>>>
>>> http://www.archivesat.com/FreeGIS_project/thread1933209.htm
>>>
>>> and GDAL
>>> apps/gdalwarpsimple.c
>>>
>>> Still lost :-)
>>
>>
>> In the very first thread, Frank says:
>>
>> "Generally speaking to produce a GeoTIFF file with a color table 
>> after using Create() to create it, you need to do the SetColorTable() 
>> *before* writing any raster data."
>>
>> I don't see any call to SetColorTable in main.c of r.out.gdal. Could 
>> this be the problem ?
>
> Yes.
> Right now I have submitted related code based on the GRASS-GDAL plugin.
> It now creates color rules, but the color interpretation is still 
> wrong (gray instead of RGB).
>
> Please someone may revisit it.

It appears that G_get_f_color_rule() doesn't return what it should. No 
clue how
to fix it.

Markus




More information about the grass-dev mailing list