[Gdal-dev] gdalwarp HFA color problem

neteler at itc.it neteler at itc.it
Thu Oct 28 01:53:23 EDT 2004


> Markus Neteler wrote:
>> On Tue, Oct 26, 2004 at 01:50:40PM -0400, Frank Warmerdam wrote:
>>
>> Frank,
>> thanks for the quick response. I did an complete recompilation, but
>> still
>> no luck. However, some changes now:
> ...
>> There is still something not reaching the new color table as
>> the resulting image appears almost black.
>
> Markus,
>
> I found one serious botch in my SetColorTable() code.  You might want to
> check
> out the latest and try again.

Frank,

excellent. Now it works perfectly.

>> And
>> gdalwarp -t_srs '+init=epsg:4326' hanoi_lsat7_brovey_UTM48N.img
>> hanoi_lsat7_brovey_LL.tif
>> Creating output file is that 1482P x 2770L.
>> Segmentation fault
>>
>> as before (in GDALSetRasterColorTable(), GDALWarpCreateOutput()).
>>
>> If I should upload this file somewhere please let me know.
>> Otherwise it is still in the web site as indicated in the previous
>> mail.
>
> I am not getting this crash but looking through the code I can see how it
> could happen.  I have committed a bunch of changes in geotiff.cpp to
> support
> writing colormaps for *16bit* data.  You will find you need to force your
> band type to UInt16 for this though.

Also tested: Instead of crash now a message appears - thanks.

>  How a TIFF colormap should be applied
> to a signed 16bit band was too confusing for me, so I stipulate in the
> code
> that the band must be UInt16.  You can use the "-ot UInt16" in your
> gdalwarp call to make this happen.

Works as well now.

> I also added better error checking so datatypes for which I don't support
> colormaps properly will report errors instead of doing weird and dangerous
> things.
>
> All this exercise for  16bit colormaps is uncovering lots of issues!

Thanks for resolving them!

best regards

 Markus




More information about the Gdal-dev mailing list