Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a set of tif files generated from a process with multiple steps. Some metadata tags are added at different steps. I would like to update the metadata of those file before distributing the files. Using gdal_edit.py -mo, I can add some new lines in the metadata, but I would like to remove some the old lines (internal tags that we use for quality control).

Is there a way to clean the metadata and/or update some of the tags ?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

See this quite a fresh GDAL ticket http://trac.osgeo.org/gdal/ticket/5619. It is now possible to overwrite or actually hide some TIFF tags. For more safe clean-up I would write out with "baseline" profile http://www.gdal.org/frmt_gtiff.html and use gdal_edit.py for adding the desired tags into it.

share|improve this answer

Based on the answer from user30184, here is a workaround to remove custom metadata

gdal_edit.py -mo 42112="" file.tif

where 42112 is the code for the non standard tag TIFFTAG_GDAL_METADATA.

For further use, using the baseline tags is another solution (however, they can be overwritten separately but not removed. The workaround is to set them to an empty string to remove their content "")

  • TIFFTAG_DOCUMENTNAME
  • TIFFTAG_IMAGEDESCRIPTION
  • TIFFTAG_SOFTWARE
  • TIFFTAG_DATETIME
  • TIFFTAG_ARTIST
  • TIFFTAG_HOSTCOMPUTER
  • TIFFTAG_COPYRIGHT
  • TIFFTAG_XRESOLUTION
  • TIFFTAG_YRESOLUTION
  • TIFFTAG_RESOLUTIONUNIT
  • TIFFTAG_MINSAMPLEVALUE (read only)
  • TIFFTAG_MAXSAMPLEVALUE (read only)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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