[gdal-dev] Metadata in OGR classes?

Ari Jolma ari.jolma at gmail.com
Sun May 5 07:57:05 PDT 2013


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?

Ari

1) 
https://github.com/ajolma/geoinformatica/blob/master/Geo-Vector/lib/Geo/Vector/Layer.pm 
(from line 794 onwards)



More information about the gdal-dev mailing list