[Qgis-developer] Layer-level metadata

Florian El Ahdab felahdab at gmail.com
Tue Feb 3 12:23:48 EST 2009


Hi the list.

I have been browsing the API searching for a way to add some custom metadata
to a QgsVectorLayer. It seems there is no way to do that.

Here is why I wanted to do that. Give me your opinion about this because I
am not sure I have a clear view of what QGis can already do about that:

Being able to add some layer specific metadata would allow the developement
of plugins that would be able to recognize the layers on which to act in
function of this metadata information. This would allow the plugins to be
designed for a generic type of layers that the user would "declare" by
setting the right metadata. Of course, the plugins can already check for
QgsMapLayer type, then for the appropriate geometry and QgsFields, but
having metada would also allow the user to specify he wants this layer to be
taken into account automatically for some handling (because the previous
elements can happen to match while the layer has nothing to do with the
custom feature you are interested in... bad luck happens...)

Typical example: I want to develop a plugin to implement S52 representation
of S57 maps. To do that, I must identify the layer type (as in S57 layer
type). Of course I get the layer type when opening the datasource from OGR
(the ogrsublayersdialog now displays this name). But once this has been
done, unless I get down to the QgsOgrProvider object, I have no way to
retrieve this information simply. Moreover, I can imagine designing my own
layers that I would like to render as S57 layers of such or such type and
therefore requiring some additionnal data that OGR wouldn't give me in that
case...

Is there anyway at this time to do this? Anyone confronted to this kind of
objective?

I hope that I made myself clear enough and that someone understands my idea
and my question.
Thanks for your comments.

Florian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20090203/04a49fd8/attachment.html


More information about the Qgis-developer mailing list