That now works, thanks. <br><br>For the benefit of others this poorly coded Python example shows the way to use the MEM dataset with GCPs and ColorTable with transparencies to then create both a paletted GTiff (no transparencies supported, so the transparent green appear in the tiff, but the GCPs are there), and a PNG (with transparencies, but without GCPs):
<br><br><div style="margin-left: 40px;">import gdal<br>import gdal_array<br>import gdalconst<br>import numpy<br><br>rows = 10<br>cols = 10<br><br>data = numpy.ones((rows,cols), numpy.uint8)<br>data[4:7,...] = 0<br><br><br>
driver = gdal.GetDriverByName('MEM')<br>image = driver.Create('dummy', rows, cols, 1, gdalconst.GDT_Byte)<br>gcps = []<br>gcps.append (gdal.GCP(1,2,3,4))<br>image.SetGCPs(gcps, '')<br><br>colorTable =
gdal.ColorTable()<br>greentransparent = (0, 255, 0, 0)<br>blue = (0,0, 255,255)<br>colorTable.SetColorEntry(0, greentransparent) <br>colorTable.SetColorEntry(1, blue) <br>b = image.GetRasterBand(1)<br>b.SetRasterColorTable
(colorTable)<br>b.WriteArray(data)<br><br>tiffdriver = gdal.GetDriverByName('GTiff')<br>tiffdriver.CreateCopy('dummy.tif', image)<br><br>pngdriver = gdal.GetDriverByName('PNG')<br>pngdriver.CreateCopy
('dummy.png', image)<br><br></div><br>Frank, while I was building from svn trunk, I stumbled over a number of C++ comments in C files/ headers<br>port/cpl_port.h line 209 <br>alg/gdal_crs.c line 402 <br>frmts/nitf/nitfile.c line 533/535
<br>frmts/nitfimage.c 2x <br>frmts/mgrs.c line 400<br>port/cps_multiproc.h line 35++
<br><br>Thanks for your very quick help.<br><br>Ludwig<br><br><br><div><span class="gmail_quote">On 28/05/07, <b class="gmail_sendername">Ludwig M Brinckmann</b> <<a href="mailto:ludwigbrinckmann@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
ludwigbrinckmann@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks, you are a star.<br><br>I will see if that works for me and report back.<br><br>Regards,<br><span><br>Ludwig</span><div><span><br><br><div><span class="gmail_quote">On 28/05/07,
<b class="gmail_sendername">Frank Warmerdam</b> <<a href="mailto:warmerdam@pobox.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
warmerdam@pobox.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Ludwig M Brinckmann wrote:<br>> Maybe this was a bit premature.
<br>><br>> Unfortunately, the MEM dataset does not support the SetGCPs method, even<br>> though the documentation says it 'should' .<br>> (" Memory datasets should support for most kinds of auxilary information
<br>> including metadata, coordinate systems, georeferencing, GCPs, color<br>> interpretation, nodata, color tables and all pixel data types.")<br><br>Ludwig,<br><br>I see your analysis is correct - the MEM driver actually lacked GCP support
<br>despite the docs. I have added this in trunk, if that is convenient for you.<br><br>Best regards,<br>--<br>---------------------------------------+--------------------------------------<br>I set the clouds in motion - turn up | Frank Warmerdam,
<a href="mailto:warmerdam@pobox.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">warmerdam@pobox.com</a><br>light and sound - activate the windows | <a href="http://pobox.com/%7Ewarmerdam" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://pobox.com/~warmerdam</a><br>and watch the world go round - Rush | President OSGeo,
<a href="http://osgeo.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://osgeo.org</a><br><br></blockquote></div><br>
</span></div></blockquote></div><br>