<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri, sans-serif" size="2">
<div>Hallo List,</div>
<div>In my tiling application am generating tiles with Gtiff as an output format. One of my inputs is of AIG format, however these inputs types comes with specific color tables, see sample below:</div>
<div> </div>
<div><font face="Courier New, monospace" size="2"> 0 255 255 255 # No-Data</font></div>
<div><font face="Courier New, monospace" size="2"> 1 0 0 210 # Gewässer </font></div>
<div><font face="Courier New, monospace" size="2"> 5 0 0 200 # Klärschlammbecken >> Wasser</font></div>
<div><font face="Courier New, monospace" size="2"> 16 102 102 125 # Versiegelte Fläche </font></div>
<div><font face="Courier New, monospace" size="2"> 20 102 102 125 # Brücken</font></div>
<div><font face="Courier New, monospace" size="2"> 32 191 191 0 # Sand, Abbau </font></div>
<div><font face="Courier New, monospace" size="2"> 33 191 191 0 # >> Sand, Abbau </font></div>
<div><font face="Courier New, monospace" size="2"> 48 125 51 0 # Fels </font></div>
<div><font face="Courier New, monospace" size="2"> 64 255 255 0 # Heide >> LaWi </font></div>
<div><font face="Courier New, monospace" size="2"> 68 255 255 0 # Moor >> LaWi</font></div>
<div><font face="Courier New, monospace" size="2"> 72 255 255 0 # Feuchtgebiete >> LaWi</font></div>
<div><font face="Courier New, monospace" size="2"> 80 255 255 0 # Landwirtschaft genutzte Fläche </font></div>
<div><font face="Courier New, monospace" size="2"> 96 224 255 0 # Mischung Wald/Feld, Park</font></div>
<div><font face="Courier New, monospace" size="2"> 100 255 180 0 # Weinbau</font></div>
<div><font face="Courier New, monospace" size="2"> 101 0 0 0 # Gewächshaus </font></div>
<div><font face="Courier New, monospace" size="2"> 102 140 255 0 # Obstbau </font></div>
<div><font face="Courier New, monospace" size="2"> 112 0 125 0 # Wald, undifferenziert </font></div>
<div><font face="Courier New, monospace" size="2"> 116 35 214 0 # Laubwald </font></div>
<div><font face="Courier New, monospace" size="2"> 120 0 214 65 # Nadelwald </font></div>
<div><font face="Courier New, monospace" size="2"> 176 255 100 0 # Vorstadt </font></div>
<div><font face="Courier New, monospace" size="2"> 208 255 50 0 # Stadt, locker bebaut</font></div>
<div><font face="Courier New, monospace" size="2"> 212 153 0 153 # Stadt, große Einzelgebäude </font></div>
<div><font face="Courier New, monospace" size="2"> 224 255 0 0 # Stadt, dicht bebaut </font></div>
<div><font face="Courier New, monospace" size="2"> 240 153 0 0 # Stadt, extrem dicht bebaut, Innenstädte </font></div>
<div><font face="Courier New, monospace" size="2"> 241 153 0 0 # Stadt, extrem dicht bebaut, Industrieflächen >> 240</font></div>
<div> </div>
<div> </div>
<div>Now, what is the best way to attach this color table to my output tifs? BTW, my tifs are 8-bit(1-band) I read somewhere that I have to first convert my tif to vrt, then manually update the <ColorTable> section with entries for each color, like this:</div>
<div> </div>
<div style="background-color: #EEEEEE;pt; "><font face="Consolas, monospace" size="2"><span style="background-color:#FFFFFF"> </span><font color="#145680"><span style="background-color:#FFFFFF"><</span></font><font color="#2B91AF"><span style="background-color:#FFFFFF">ColorTable</span></font><font color="#145680"><span style="background-color:#FFFFFF">></span></font></font></div>
<div style="background-color: #EEEEEE;pt; "><font face="Consolas, monospace" size="2"><span style="background-color:#FFFFFF"> </span><font color="#145680"><span style="background-color:#FFFFFF"><</span></font><font color="#2B91AF"><span style="background-color:#FFFFFF">Entry</span></font><span style="background-color:#FFFFFF">
c1</span><font color="#145680"><span style="background-color:#FFFFFF">=</span></font><font color="#800000"><span style="background-color:#FFFFFF">"238"</span></font><span style="background-color:#FFFFFF"> c2</span><font color="#145680"><span style="background-color:#FFFFFF">=</span></font><font color="#800000"><span style="background-color:#FFFFFF">"238"</span></font><span style="background-color:#FFFFFF">
c3</span><font color="#145680"><span style="background-color:#FFFFFF">=</span></font><font color="#800000"><span style="background-color:#FFFFFF">"238"</span></font><span style="background-color:#FFFFFF"> </span><font color="#145680"><span style="background-color:#FFFFFF">/></span></font></font></div>
<div style="background-color: #EEEEEE;pt; "><font face="Consolas, monospace" size="2"><span style="background-color:#FFFFFF"> </span><font color="#145680"><span style="background-color:#FFFFFF"><</span></font><font color="#2B91AF"><span style="background-color:#FFFFFF">Entry</span></font><span style="background-color:#FFFFFF">
c1</span><font color="#145680"><span style="background-color:#FFFFFF">=</span></font><font color="#800000"><span style="background-color:#FFFFFF">"237"</span></font><span style="background-color:#FFFFFF"> c2</span><font color="#145680"><span style="background-color:#FFFFFF">=</span></font><font color="#800000"><span style="background-color:#FFFFFF">"237"</span></font><span style="background-color:#FFFFFF">
c3</span><font color="#145680"><span style="background-color:#FFFFFF">=</span></font><font color="#800000"><span style="background-color:#FFFFFF">"237"</span></font><span style="background-color:#FFFFFF"> </span><font color="#145680"><span style="background-color:#FFFFFF">/></span></font></font></div>
<div style="background-color: #EEEEEE;pt; "><font face="Consolas, monospace" size="2"><span style="background-color:#FFFFFF"> </span><font color="#145680"><span style="background-color:#FFFFFF"><</span></font><font color="#2B91AF"><span style="background-color:#FFFFFF">Entry</span></font><span style="background-color:#FFFFFF">
c1</span><font color="#145680"><span style="background-color:#FFFFFF">=</span></font><font color="#800000"><span style="background-color:#FFFFFF">"236"</span></font><span style="background-color:#FFFFFF"> c2</span><font color="#145680"><span style="background-color:#FFFFFF">=</span></font><font color="#800000"><span style="background-color:#FFFFFF">"236"</span></font><span style="background-color:#FFFFFF">
c3</span><font color="#145680"><span style="background-color:#FFFFFF">=</span></font><font color="#800000"><span style="background-color:#FFFFFF">"236"</span></font><span style="background-color:#FFFFFF"> </span><font color="#145680"><span style="background-color:#FFFFFF">/></span></font></font></div>
<div style="background-color: #EEEEEE;pt; "><font face="Consolas, monospace" size="2"><span style="background-color:#FFFFFF"> </span><font color="#145680"><span style="background-color:#FFFFFF"><</span></font><font color="#2B91AF"><span style="background-color:#FFFFFF">Entry</span></font><span style="background-color:#FFFFFF">
c1</span><font color="#145680"><span style="background-color:#FFFFFF">=</span></font><font color="#800000"><span style="background-color:#FFFFFF">"229"</span></font><span style="background-color:#FFFFFF"> c2</span><font color="#145680"><span style="background-color:#FFFFFF">=</span></font><font color="#800000"><span style="background-color:#FFFFFF">"229"</span></font><span style="background-color:#FFFFFF">
c3</span><font color="#145680"><span style="background-color:#FFFFFF">=</span></font><font color="#800000"><span style="background-color:#FFFFFF">"229"</span></font><span style="background-color:#FFFFFF"> </span><font color="#145680"><span style="background-color:#FFFFFF">/></span></font></font></div>
<div style="background-color: #EEEEEE;pt; "><font face="Consolas, monospace" size="2"><span style="background-color:#FFFFFF"> </span><font color="#145680"><span style="background-color:#FFFFFF"></</span></font><font color="#2B91AF"><span style="background-color:#FFFFFF">ColorTable</span></font><font color="#145680"><span style="background-color:#FFFFFF">></span></font></font></div>
<div> </div>
<div>Is this the right approach? Besides, I would like to automate the whole workflow. Is there a script that I can use to automate this workflow?</div>
<div> </div>
<div> </div>
<div>Thanks and regards</div>
<div> </div>
<div>Moses</div>
<div> </div>
</font>
</body>
</html>