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

Matt Williamson matthewdw at gmail.com
Tue Feb 23 14:12:14 EST 2010


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



More information about the gdal-dev mailing list