[gdal-dev] gdal_retile not generating alpha band

Tom Wardrop TomW at msc.qld.gov.au
Sun May 3 22:23:25 PDT 2015


Hi all,

I retiled whole lot of imagery over the weekend using the following gdal_retile command:


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

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.

I was under the impression that "-co ALPHA=YES” 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 gdal_retile to generate an alpha channel when required?

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.

Any feedback is appreciated.

Cheers,
Tom


________________________________

Mareeba Shire Council Disclaimer

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.

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


More information about the gdal-dev mailing list