[gdal-dev] get corner coordinates from gdalopen()

achrysochoou achrysochoou at hotmail.com
Thu Apr 15 12:38:00 EDT 2010

I have a geotiff and i am using python to read it. I am trying to extract
the corner coordinates and store them in different variables. This is what i
have done so far,
dataset = gdal.Open(tif_path)
print 'zone and Hemisphere are:',
geotransform = dataset.GetGeoTransform()
print 'Origin = (',geotransform[0], ',',geotransform[3],')'
i have tried more methods with no luck (or perhaps i simply do not get
it...) such as,
print 'GetProjectionRef is: ',dataset.GetProjectionRef()
print 'GetGCPProjection is: ',dataset.GetGCPProjection()
print 'GetGCPs() is: ',dataset.GetGCPs()
I tried shell commands such as 'gdalinfo' which gives information about the
geotiff but i can't access the corner coordinates from the shell (or i don't
know how...). I am currently thinking of counting the pixels and calculating
the coordinates like that but it seems i should ask first before doing sth
like that...
I would like to save the corner coordinates like this,
lower_right = ..., lower_left = ..., upper_right = ..., etc
Any suggestions? 
Thanks in advance!
View this message in context: http://n2.nabble.com/get-corner-coordinates-from-gdalopen-tp4908657p4908657.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.

More information about the gdal-dev mailing list