Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#5542 closed enhancement (fixed)

gdalinfo: output band metadata from custom domains

Reported by: cauthmann Owned by: warmerdam
Priority: normal Milestone: 2.0.0
Component: Utilities Version: unspecified
Severity: normal Keywords:



I tried getting a driver to return some useful metadata from the files, but gdalinfo never displayed any of it. As it turns out, the culprit was gdalinfo. It will never report metadata in custom domains from the bands, even if explicitely requested in the command line.

So I set out to rewrite the metadata handling. It will now use the same function to display both dataset metadata and band metadata. While I was at it, I fixed a violation of the DRY-principle, introducing a small helper function to get a metadata list, loop over it and output everything.

Since there's probably someone out there with a script that parses the output of gdalinfo, I was careful not to introduce any functional changes in the output. The only visible difference should be that band metadata is actually printed.

Patch is attached for review and/or committing.

Attachments (1)

gdalinfo_metadata.patch (12.5 KB) - added by cauthmann 7 years ago.

Download all attachments as: .zip

Change History (3)

Changed 7 years ago by cauthmann

Attachment: gdalinfo_metadata.patch added

comment:1 Changed 7 years ago by Even Rouault

Component: GDAL_RasterUtilities
Milestone: 2.0
Resolution: fixed
Status: newclosed

Thanks. I've just slightly adapted your patch to get the exact format as before (i.e. re-add 2 space indentation for band metadata)

trunk r27478 "gdalinfo: display extra metadata domains attached to band, and refactor code a bit (derived from patch by cauthmann, #5542)"

comment:2 Changed 6 years ago by Even Rouault


Milestone renamed

Note: See TracTickets for help on using tickets.