[gdal-dev] Possible bug in gdaldem color-relief, zero always transparent

Even Rouault even.rouault at mines-paris.org
Tue Feb 23 15:50:44 EST 2010


I think the problem lies in you .clr file. I pasted the content from the email 
into a file, and when looking with an hexadecimal editor, I see that there 
are several instances of a strange hexadecimal sequence "0xc2 0xa0" that is 
used as a separator between the figures. If your original .clr file has 
really those, and they are not an artifact of pasting into the email, then 
this is the cause of your issue, as the parser only supports spaces, 
tabulations, commas or colons. When fixing the clr file, I get expected 
results.

Le Tuesday 23 February 2010 20:12:14 Matt Williamson, vous avez écrit :
> Hello List,
>
> I may have encountered a bug in gdaldem color-relief. When I use it to
> apply a color map to a GeoTIFF band that has positive and negative and zero
> values, the zero pixels are always translated as having alpha 0, even if
> the color map file explicitly states zero values should be opaque.
>
> e.g., I'm using a command like this one:
>
> gdaldem color-relief MinT_SFC.EPSG_900913.tif colortables/T_SFC.clr
> pngs/test.png -alpha -b 1 -of PNG
>
> and a segment of the color table file reads as follows:
>
> -10.0   64  64  64
> -0.1   127 127 127 255
> 0       64  64 127 255
> 0.1     64  64 127 255
> 9.9    127 127 192
>
> I can provide a sample dataset that produces this problem, but I'm not sure
> what the etiquette on attaching files in this list is.
>
> Can anyone confirm they see the same behavior? I'm using 1.7.1, compiled
> locally. The behavior appears whether my -of is PNG or GTiff, so I don't
> think it's a driver issue.
>
> I know this has nothing to do with generating elevation maps, but it's too
> convenient a way to apply a color map to float data--I had been using
> mapserver just to make colorized PNGs, and gdaldem is so much cleaner.
>
> Thanks!
>
> -Matt
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev




More information about the gdal-dev mailing list