id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc 3780,python GetDescription() returns empty strings on > 1.7.0,mattrigal,warmerdam,"Hi Frank and Even, Thanks for your replies. From what I can see, it is not related to the aux.xml files, because this still works after deletion. I must add that I have the same problem when working on .pix images, so it is probably not driver specific... it may be specific to the SWIG or to python... Best Regards, Matthieu > Selon Matthieu Rigal : Matthieu, I can reproduce in trunk too. I'm not aware that this issue was known. I'm even a bit surprised this has worked before as the SetDescription() method in GDALPamRasterBand doesn't seem to have been ever overloaded, so a bit of investigation is necessary. In 1.6.x branch, I suppose this worked before the band description was written in a .aux.xml file ? Best regards, Even On Monday 11 October 2010 16:33:51 Frank Warmerdam wrote: > Matthieu Rigal wrote: > > Hi folks, > > > > Currently running GDAL 1.7.1, I noticed a regression towards the 1.6.x > > branch which I could not find in the tickets. > > > > The GetDescription() always seems to return empty strings, except for > > just created file and just setted description... > > Here is a description of the bug, I don't think it is quite the expected > > > > result : > >>>> from osgeo import gdal > >>>> xT = gdal.GetDriverByName('GTiff').Create('test-desc.tif',10,10,1) > >>>> xB = xT.GetRasterBand(1) > >>>> xB.SetDescription('test') > >>>> xT = None > >>>> xT2 = gdal.Open('test-desc.tif') > >>>> xT2.GetRasterBand(1).GetDescription() > > > > '' > > > > The 1.6.1 returns: > > 'test' > > Is it a known bug ? Solved in further versions ? > Matthieu, > > I confirmed the problem but was unable to reproduce correction operation > against the current 1.6 branch so whatever changed appears to have changed > there as well. > I presume with 1.6.1 you are seeing a .aux.xml file created - is that > right? > There is no special handling of the raster band description in the geotiff > driver itself, so saving it falls to the GDALPamRasterBand. I see it also > has no override for SetDescription() so it falls to GDALMajorObject to > hold the description. In GDALPamRasterBand::SerializeToXML() a non-empty > description will be saved to the .aux.xml file; however, SerializeToXML() > is not called unless there is some record of the PAM information being > dirty. > Since SetDescription() was not overridded in GDALPamRasterBand there was > no mechanism to set GPF_DIRTY in the pam layer. > Without more investigation I can't see why things regressed after 1.6.1. > I suspect it was a case of other information being handled a different > way so less gets written to the .aux.xml file. > I believe the fix is to override SetDescription() in GDALPamRasterBand > and to set the dirty flag there. > I'd appreciate it if you could file a ticket, and copy in the above > discussion. > ",defect,closed,normal,1.8.0,GDAL_Raster,svn-trunk,normal,fixed,pam description,