I have 2 Python Qgis plugins. The first plugin is creating a QgsVectorLayer via the ogr dataprovider. The second plugin is offering some services on the features in the layer.

I need to pass some additional information (a single string) which is not in the file that ogr reads to the second plugin. What's the best /easiest way to attach it to the layer so the second plugin can easily extract it?


If it's just one additional information for each layer, maybe you could pass it through the metadata. In other case, if there are different informations for each feature in the layer you could join an attribute table.

  • Thanks, the metadata idea sounds promising. However, can you give me more details on how to do that. It seems easy to query metadata on a layer, but I can't seem to find a method to set it?
    – user12889
    Aug 20 '14 at 0:33
  • I found this: osgeo-org.1560.x6.nabble.com/…. This would work in my case but remains unsatisfactory for the reasons mentioned in the link.
    – user12889
    Aug 20 '14 at 3:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.