[gdal-dev] metadata - OGRLayer::GetInfo()

Even Rouault even.rouault at mines-paris.org
Sat Mar 3 17:28:03 EST 2012


Le samedi 03 mars 2012 22:32:53, Martin Landa a écrit :
> Hi,
> 
> is there any way how to deal with metadata related to OGRDatasource? I
> just found OGRLayer::GetInfo() which could be used for layer-related
> key:values metadata. But it is deprecated and no OGR drivers are using
> this method. So I am not really sure how to deal with
> (datasource/layer-related) metadata when developing OGR driver.

Martin,

There's no standardized way to do this unfortunately and GetInfo() is actually  
advertized as deprecated. 

Currently, when I need exposing metadata in a OGR driver, I create a dedicated 
layer that is returned by an overloaded GetLayerByName() method on the 
datasource object. For example, in the WFS driver, you can request the 
WFSLayerMetadata and WFSGetCapabilities layers.

Perhaps if the GDAL / OGR "grand unification" takes place one day and OGR 
layers inherit from GDALMajorObject for example, this will be possible in a 
more convenient way.

Best regards,

Even


More information about the gdal-dev mailing list