I have a geotiff file with class values (0, 1,  2, 3, and 4).
I want to show each class as different 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
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to