Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

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:

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.