[gdal-dev] Metadata in OGR classes?

Even Rouault even.rouault at mines-paris.org
Sun May 5 09:52:35 PDT 2013


Le dimanche 05 mai 2013 16:57:05, Ari Jolma a écrit :
> Hi,
> 
> On the GDAL side there is the MajorObject class, which adds metadata to
> GDAL classes and objects like Datasets. On OGR side there is no such
> thing, AFAIK. Some OGR classes have a TestCapability method, which can
> in principle support arbitrary capabilities, but there is no method,
> which would return class or object related information.
> 
> For example a geotiff that I have returns four TIFFTAG_xxx keys and
> respective values when I open it into a GDAL Dataset.
> 
> The reason I was looking for metadata method in OGR is that in some GUI
> code I want to support generic and interactive creation of OGR
> DataSources. For this purpose I've added to the OGR Driver class a
> method DataSourceTemplate(1). This is in Perl code and outside of GDAL,
> I use the Driver class from the bindings. The DataSourceTemplate method
> returns a string, which can be used to create a dialog box for asking
> arguments for the data source from the user. For example a GeoJSON
> driver returns the string "<URL>[@<username>:][<password>]". This tells
> the GUI code that a dialog box is needed which asks from the user a URL
> and optionally username and password. Of course mostly the template is
> simply <filename> and for database, GeoJSON, WFS and some other drivers
> it is something else.
> 
> I was thinking that this kind of additional information would be best
> available as metadata.
> 
> Any thoughts on these?

On the GDAL site we have creation options that indicate options available for 
Create() and CreateCopy() methods. Something similar for connexion strings 
could be useful indeed.

Unfortunately OGR is currently orphaned in terms of metadata. If it is 
reconciled with GDAL, I guess that OGRSFDriver, OGRDataSource and OGRLayer 
classes could inherit from GDALMajorObject to expose metadata capabilities.

> 
> Ari
> 
> 1)
> https://github.com/ajolma/geoinformatica/blob/master/Geo-Vector/lib/Geo/Vec
> tor/Layer.pm (from line 794 onwards)
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list