I am loading imagery as raster layer through a URL. I need to store its metadata as JSON string in db for future reference.

I tried getting the metadata via layer.metadata() and then tried to get json.dump() for that object but an empty string was returned.

When I use the layer.htmlMetadata() function I do get all the information but I need all the details as JSON.

put on hold as off-topic by ahmadhanb, Jochen Schwarze, wetland, whyzar, BERA Mar 15 at 14:00

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "When seeking help to debug/write/improve code always provide the desired behavior, a specific problem/error and the shortest code (as formatted text, not pictures) needed to reproduce it in the question body. Providing a clear problem statement and a code attempt helps others to help you." – ahmadhanb, Jochen Schwarze, wetland, whyzar, BERA
If this question can be reworded to fit the rules in the help center, please edit the question.

  • I need to form a JSON containing all the data displayed while viewing Layer Properties in Information Tab. – Faiz Kidwai Mar 15 at 7:13

Browse other questions tagged or ask your own question.