[gdal-dev] python GetDescription() returns empty strings on 1.7.1

Matthieu Rigal rigal at rapideye.de
Mon Oct 11 11:02:15 EDT 2010


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...

I just filed this discussion as a ticket, her you can find it 
http://trac.osgeo.org/gdal/ticket/3780

Thanks for all the great job you're doing !
Best Regards,
Matthieu


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.
> > 
> > Teh 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.
> 
> Best regards,


-- 
Matthieu Rigal
Product Development

RapidEye AG                           Tel:  +49-(0)3381-89 04 331
Molkenmarkt 30                       Fax: +49-(0)3381-89 04 101
14776 Brandenburg/Havel
Germany                                  http://www.rapideye.de

RapidEye AG
Molkenmarkt 30
14776 Brandenburg an der Havel
Germany
 
Follow us on Twitter! www.twitter.com/rapideye_ag
 
Head Office/Sitz der Gesellschaft: Brandenburg an der Havel
Management Board/Vorstand: Wolfgang G. Biedermann
Chairman of Supervisory Board/Vorsitzender des Aufsichtsrates: 
Juergen Breitkopf 
Commercial Register/Handelsregister Potsdam HRB 17 796
Tax Number/Steuernummer: 048/100/00053
VAT-Ident-Number/Ust.-ID: DE 199331235
DIN EN ISO 9001 certified
 
*************************************************************************
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese
E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe dieser E-Mail ist nicht gestattet.
 
The information in this e-mail is intended for the named recipients
only. It may contain privileged and confidential information. If you
have received this communication in error, any use, copying or
dissemination of its contents is strictly prohibited. Please erase all
copies of the message along with any included attachments and notify
RapidEye AG or the sender immediately by telephone at the number
indicated on this page.


More information about the gdal-dev mailing list