[gdal-dev] SetColorTable() issues on GTiff with python bindings

Ingmar N initze at ucc.ie
Thu Sep 27 07:12:42 PDT 2012


Hello,
I would like to add a Colortable to a GeoTiff. Running the SetColorTable()
function, python returns "3". GetColorTable() returns empty, no colortable
is attached.
After browsing the internet for a solution, I tried to run the procedure on
a newly created GTiff (which was often suggested). Probably any issues with
the colortable?
The file is not Write-protected or problematic otherwise, WriteArray() for
example works without any problem.


ds2=dr.Create('C:\\testfolder\\X.tif',ds.RasterXSize,ds.RasterYSize,1,gdal.GDT_Int16)
ct=gdal.ColorTable()
ct.CreateColorRamp(0,(178,223,138),5,(255,127,0))
outband=ds2.GetRasterBand(1)
outband.SetColorTable(ct) # returns 3

Versions:
python 2.7
gdal 1.9.1

Any Suggestions?
Thanks for your help



--
View this message in context: http://osgeo-org.1560.n6.nabble.com/SetColorTable-issues-on-GTiff-with-python-bindings-tp5004969.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list