<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px"><div>I have a geotiff file with class values (0, 1,  2, 3, and 4).</div><div>I want to show each class as different rgb color.</div><div><br></div><div>

So, I created the text file (color_relief.txt) which contans the following:</div><div><br></div><div>0 55 78 94</div><div>1 98 23 64</div><div>2 112 35 99</div><div>3 34 67 72</div><div>4 78 250 60</div><div><br></div><div>

Then I run the following code using python:</div><div><br></div><div>import subprocess</div><div>in_file =  'single_band.tif'</div><div>text_file = 'color_relief.txt'</div><div>gdaldem = 'C:\\Python27\\Lib\\site-packages\\osgeo\\gdaldem.exe'</div>

<div>out_file =  'result.tif'</div><div>subprocess.call([gdaldem ,'color-relif',in_file,text_file,out_file,'-exact_color_entry','-b','1'],shell=True)</div><div>in_file, out_file = None, None</div>

</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Unfortunately, no result file is obtained.</div><div style="font-family:arial,sans-serif;font-size:13px">

What is wrong with my code?</div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr">cleo</div></div>
<br><br><div class="gmail_quote">On Fri, Aug 22, 2014 at 6:37 PM, Cleo Drakos <span dir="ltr"><<a href="mailto:cleo21drakos@gmail.com" target="_blank">cleo21drakos@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr"><div><div>I have a single band geotiff file with discrete data in bytes.</div><div>The unique data values are 0, 1,  2, 3, and 4.</div><div>I want to intrepret each unique value as rgb color.</div><div><br>

</div>
<div>So, I created the text file (color_relief.txt) which contans the following:</div><div><br></div><div>0 55 78 94</div><div>1 98 23 64</div><div>2 112 35 99</div><div>3 34 67 72</div><div>4 78 250 60</div><div><br></div>


<div>Then I run the following code using python:</div><div><br></div><div>import subprocess</div><div>in_file =  'single_band.tif'</div><div>text_file = 'color_relief.txt'</div><div>gdaldem = 'C:\\Python27\\Lib\\site-packages\\osgeo\\gdaldem.exe'</div>


<div>out_file =  'result.tif'</div><div>subprocess.call([gdaldem ,'color-relif',in_file,text_file,out_file,'-exact_color_entry','-b','1'],shell=True)</div><div>in_file, out_file = None, None</div>


</div><div><br></div><div>Unfortunately, no result file is obtained.</div><div>What is wrong with my code?</div><span class="HOEnZb"><font color="#888888"><br clear="all"><div><div dir="ltr">cleo</div></div>
</font></span></div>
</blockquote></div><br></div>