<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>
<div>
<div>It would be really nice if I could find a single pass solution for this. I need to retile 200GB of imagery and would prefer not to have to process it twice. I think my work-around using gdal_translate is a better solution than converting black pixels to
 alpha, besides, I’m using GeoServer with the ImagePyramid plugin which I don’t believe supports “nodata” transparency. It needs an alpha channel.</div>
<div>
<div style="font-family: Calibri; font-size: medium;">
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<br>
</p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<b><span style="font-size: 10pt; font-family: Arial, sans-serif;">Tom Wardrop</span></b><span style="font-size: 8pt; font-family: Arial, sans-serif;"><br>
</span><span style="font-size: 9pt; font-family: Arial, sans-serif;">IT Development Officer</span><span style="font-size: 8pt; font-family: Arial, sans-serif;"><br>
</span><span style="font-family: Arial, sans-serif; font-size: 12px;">ICT Section, Systems & Customer Service Group</span></p>
<div>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size: 5pt; font-family: Arial, sans-serif;"> </span><span style="font-size: 8pt; font-family: Arial, sans-serif;"><br>
</span><img width="180" height="52" src="cid:CC12026D-1950-4134-BF94-571CB34BD6E6" align="left" alt="Description: C:\Users\royl.MSC\AppData\Roaming\Microsoft\Signatures\logo\logo.png" v:shapes="Picture_x0020_2" type="image/png"><span style="font-size: 3pt; font-family: Arial, sans-serif;"> </span><span style="font-size: 8pt; font-family: Arial, sans-serif;"><br>
<b>Phone:</b> 1300 308 461  |  <b>Direct:</b> 07 4086 </span><span style="font-family: Arial, sans-serif; font-size: 11px;">4668</span><span style="font-size: 8pt; font-family: Arial, sans-serif;">  |  <b>Fax:</b> 07 4092 3323<br>
<a href="mailto:RoyL@msc.qld.gov.au" style="color: purple;"><b><span style="color: black; text-decoration: none;">Email:</span></b><span style="color: black; text-decoration: none;"> tomw@msc.qld.gov.au</span></a>  |  <a href="http://www.msc.qld.gov.au/" style="color: purple;"><b><span style="color: black; text-decoration: none;">Website:</span></b><span style="color: black; text-decoration: none;"> www.msc.qld.gov.au</span></a><br>
65 Rankin Street, Mareeba  |  PO Box 154, Mareeba, Queensland, Australia, 4880<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size: 8pt; font-family: Arial, sans-serif;"> </span></p>
<div>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size: 10.5pt; font-family: Webdings; color: green;">ý</span><span style="font-size: 7pt; font-family: Arial, sans-serif; color: green;"> Go green, keep it on screen - think before you print<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p> </o:p></p>
</div>
</div>
</div>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>David Strip <<a href="mailto:gdal@stripfamily.net">gdal@stripfamily.net</a>><br>
<span style="font-weight:bold">Date: </span>Tuesday, 5 May 2015 12:49 am<br>
<span style="font-weight:bold">To: </span>Tom Wardrop <<a href="mailto:tomw@msc.qld.gov.au">tomw@msc.qld.gov.au</a>>, "<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>" <<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [gdal-dev] gdal_retile not generating alpha band<br>
</div>
<div><br>
</div>
<div>
<div bgcolor="#FFFFFF" text="#000000">This sounds more like a problem with a missing NODATA value rather than transparency/alpha. As far as I can tell from the docs, there is no means to specify the NODATA value in the gdal_retile command, including the CO
 options. If the only place that true black occurs is in the regions with no input, you could use gdal_edit.py to add a NODATA value.<br>
<br>
On 5/3/2015 11:23 PM, Tom Wardrop wrote:
<blockquote type="cite">
<div style="font-family: Calibri, sans-serif; font-size: 14px;
        color: rgb(0, 0, 0);">
Hi all,</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px;
        color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px;
        color: rgb(0, 0, 0);">
I retiled whole lot of imagery over the weekend using the following gdal_retile command:</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px;"><br>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px;">
<p style="margin: 0px; font-size: 12px; font-family: Courier;">gdal_retile.py -v -r bilinear -levels 8 -ps 2048 2048 -s_srs EPSG:28355 -co "TILED=YES" -co "ALPHA=YES" -targetDir ~/output ~/input/*.tif</p>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px;"><br>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px;">The result was good until I realised all the areas that should be transparent were instead black. It seems the problem is the source imagery didn’t have an alpha channel; it didn’t need one as
 there was no transparent data to represent. Because the source imagery didn’t fill the entire extent, gdal_retile had to create loads of transparent and partially-transparent tiles, which of course wound up black.</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px;"><br>
</div>
<div><font face="Calibri,sans-serif">I was under the impression that "</font><font face="Courier"><span style="font-size:
            12px;">-co ALPHA=YES</span></font><font face="Calibri,sans-serif">” would instruct gdal_retile to generate an alpha channel
 for all the generated tiles. Is this a bug? If not, how do I otherwise instruct </font><font face="Calibri,sans-serif">gdal_retile to generate an alpha channel when required?</font></div>
<div><font face="Calibri,sans-serif"><br>
</font></div>
<div><font face="Calibri,sans-serif">I’m working around this by using gdal_translate to re-save the source imagery with an (empty) alpha channel, so gdal_retile now outputs transparent tiles. </font></div>
<div><font face="Calibri,sans-serif"><br>
</font></div>
<div><font face="Calibri,sans-serif">Any feedback is appreciated.</font></div>
<div>
<p class="MsoNormal" style="font-family: Calibri, sans-serif;
          font-size: 11pt; margin: 0cm 0cm 0.0001pt;">
<br>
</p>
<p class="MsoNormal" style="color: rgb(0, 0, 0); margin: 0cm 0cm
          0.0001pt;">
Cheers,</p>
<p class="MsoNormal" style="color: rgb(0, 0, 0); margin: 0cm 0cm
          0.0001pt;">
Tom</p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif;
          font-size: 11pt; color: rgb(0, 0, 0); margin: 0cm 0cm
          0.0001pt;">
<o:p> </o:p></p>
</div>
<br>
</blockquote>
<br>
</div>
</div>
</span><br>
<hr>
<font face="Arial" color="Gray" size="1"><br>
Mareeba Shire Council Disclaimer<br>
<br>
This message and any attachments may contain privileged and confidential information intended only for the use of the intended addressee(s). Any unauthorised use of this material is prohibited. If you received this message in error please notify the sender
 immediately, delete the message and destroy any printed or electronic copies. Opinions expressed in this e-mail are those of the sender and do not necessarily represent the views of the Mareeba Shire Council. Council does not accept any responsibility for
 the loss or damage that may result from reliance on, or the use of, any information contained in this e-mail or attachments.<br>
<br>
We recommend that you scan this e-mail and any attachments for viruses before opening. This Council does not accept liability for any loss or damage incurred either directly or indirectly from opening this e-mail or any attachments to it.<br>
</font>
</body>
</html>