[gdal-dev] why gdaldem is not working?

Cleo Drakos cleo21drakos at gmail.com
Fri Aug 22 20:53:16 PDT 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140823/629be00d/attachment.html>


More information about the gdal-dev mailing list