<div dir="ltr">I have a geotiff file with class values (0, 1, 2, 3, and 4).<br>I want to show each class as different rgb color.<br><br>So, I created the text file (color_relief.txt) which contans the following:<br><br>0 55 78 94<br>
1 98 23 64<br>2 112 35 99<br>3 34 67 72<br>4 78 250 60<br><br>Then I run the following code using python:<br><br>import subprocess<br>in_file = 'single_band.tif'<br>text_file = 'color_relief.txt'<br>gdaldem = 'C:\\Python27\\Lib\\site-packages\\osgeo\\gdaldem.exe'<br>
out_file = 'result.tif'<br>subprocess.call([gdaldem ,'color-relif',in_file,text_file,out_file,'-exact_color_entry','-b','1'],shell=True)<br>in_file, out_file = None, None<br><br>Unfortunately, no result file is obtained.<br>
What is wrong with my code?<br><br>cleo
</div>