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.

Please help me with a python code to read metadata from a Raster file. Thanks

share|improve this question

2 Answers 2

Two options:

1)Use GDAL Python bindings, the code is here.

2)Run GDALINFO from python and capture the stdout, to get a string with the metadata:

import os
metadata = os.popen('gdalinfo ../rasterfile.tiff').read()
print metadata
share|improve this answer
Thanks, This has helped alot. –  user1951 Feb 23 '11 at 10:13

You could use gdalinfo: http://www.gdal.org/gdalinfo.html

share|improve this answer

Your Answer


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.