[gdal-dev] Trouble with gdaldem -exact_color_entry
Daniel Mannarino
daniel.mannarino at gmail.com
Tue Aug 13 23:28:34 PDT 2024
Hi all!
I'm having trouble getting gdaldem to work the way I believe it's supposed
to. In particular I have given it a single-band uint8 GeoTIFF and tried to
map the values to RGB bands via a colormap using exact matching, but the
resulting GeoTIFF is invariably all zeroes (as if there were no matches).
Using -nearest_color_entry or not specifying -exact_color_entry yields the
expected results, but I only want exact matches. I have tried specifying
values to match as both floats (0.0, 1.0, etc.) and ints (0, 1, etc.).
Adding an alpha channel makes no difference in this sense. Am I doing
something wrong, or is there an issue with gdaldem? Here are the commands I
used, and a link to the files in question:
gdaldem color-relief -co COMPRESS=DEFLATE -co TILED=YES -co BLOCKXSIZE=256
-co BLOCKYSIZE=256 -co SPARSE_OK=TRUE -co INTERLEAVE=BAND
-exact_color_entry -alpha foo.tif colormap.txt exact_foo_with_alpha.tif
gdaldem color-relief -co COMPRESS=DEFLATE -co TILED=YES -co BLOCKXSIZE=256
-co BLOCKYSIZE=256 -co SPARSE_OK=TRUE -co INTERLEAVE=BAND
-nearest_color_entry -alpha foo.tif colormap.txt nearest_foo_with_alpha.tif
gdaldem color-relief -co COMPRESS=DEFLATE -co TILED=YES -co BLOCKXSIZE=256
-co BLOCKYSIZE=256 -co SPARSE_OK=TRUE -co INTERLEAVE=BAND -alpha foo.tif
colormap.txt gradient_foo_with_alpha.tif
https://drive.google.com/drive/folders/17q3zQAcOqPTo4f8-swWEgrpQ9sfufasR?usp=share_link
These commands were performed with GDAL 3.9.1 installed on MacOS/ARM via
Homebrew, though the problem also occurs in our AMD64 AWS instances running
Linux and GDAL 3.8.4 with the official Docker images as a base.
Thanks for any help!
Daniel Mannarino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240814/48a65286/attachment.htm>
More information about the gdal-dev
mailing list