[gdal-dev] Convert Gray scale large multiband geotiff file to multiband RGBA with Python

E.C esther.cardoso at terras.agr.br
Fri May 3 04:47:43 PDT 2019


Hello,

I'm new to GIS/GDAL. I'm working with 33-band geotiff files, with each band
representing data from 1 year. Currently, our application accesses a local
color map, which isn't efficient enough, so I'm trying to find a quick way
(Shell or Python) to apply color and categories to the tiff files. I have
tried 2 approaches:
First, I tried editing the vrt file with a python script, then converting it
back to tiff, but received the error "Unable to export color table to
GeoTIFF file. Color tables can only be written to 1 band or 2 bands Byte or
UInt16 GeoTIFF files.".
Then, I tried separating each band, then merging them together, but the
categories disappeared from the output file.
Is there any way to do that conversion?

Here's a sample of the data I'm working with:
original file:
https://drive.google.com/open?id=1-eFqk-6UJ9yQn1aEt1OJ_ElWmcAEvE9-

1-band vrt file with desirable output: 
https://drive.google.com/open?id=1Cf7EVavyN6mmPoxLlO560Jpxyyks1VTt

Best regards.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list