[gdal-dev] gdaldem color-relief does not produce any result

Cleo Drakos cleo21drakos at gmail.com
Fri Aug 22 02:37:55 PDT 2014


I have a single band geotiff file with discrete data in bytes.
The unique data values are 0, 1,  2, 3, and 4.
I want to intrepret each unique value as rgb color.

So, I created the text file (color_relief.txt) which contans the following:

0 55 78 94
1 98 23 64
2 112 35 99
3 34 67 72
4 78 250 60

Then I run the following code using python:

import subprocess
in_file =  'single_band.tif'
text_file = 'color_relief.txt'
gdaldem = 'C:\\Python27\\Lib\\site-packages\\osgeo\\gdaldem.exe'
out_file =  'result.tif'
subprocess.call([gdaldem
,'color-relif',in_file,text_file,out_file,'-exact_color_entry','-b','1'],shell=True)
in_file, out_file = None, None

Unfortunately, no result file is obtained.
What is wrong with my code?

cleo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140822/9ea349b0/attachment.html>


More information about the gdal-dev mailing list