<div>Hello Tom<div>Thanks. It also worked for me</div><div><br></div><div>Thanks</div><div>Monica</div><br><div class="gmail_quote">On Tue, Jun 29, 2010 at 3:01 PM, Kralidis,Tom [Ontario] <span dir="ltr"><<a href="mailto:Tom.Kralidis@ec.gc.ca">Tom.Kralidis@ec.gc.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br>
<br>
> -----Original Message-----<br>
> From: <a href="mailto:gdal-dev-bounces@lists.osgeo.org">gdal-dev-bounces@lists.osgeo.org</a><br>
> [mailto:<a href="mailto:gdal-dev-bounces@lists.osgeo.org">gdal-dev-bounces@lists.osgeo.org</a>] On Behalf Of Monica Buescu<br>
> Sent: Tuesday, 29 June 2010 09:49<br>
> To: <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
> Subject: [gdal-dev] Retrieving pixel corners through Python-gdal<br>
><br>
</div><div><div></div><div class="h5">> Greetings<br>
><br>
> I'm a kind of newbie in GDAL specially in Python-GDAL. I'm<br>
> doing a script to do some minor image processing but I need<br>
> to retrieve, in a Python Scrpt, coorners coordinates<br>
> (top-left; bottom-right). Is there any way to retrieve this<br>
> using gdalpython?<br>
><br>
> Thanks<br>
><br>
> Monica<br>
><br>
<br>
</div></div><div><div></div><div class="h5">This has worked for me:<br>
<br>
import osgeo.gdal as gdal<br>
<br>
ds = gdal.Open('foo.tif')<br>
gt = ds.GetGeoTransform()<br>
width = ds.RasterXSize<br>
height = ds.RasterYSize<br>
miny = gt[3] + width*gt[4] + height*gt[5]<br>
maxx = gt[0] + width*gt[1] + height*gt[2]<br>
# bbox of raster (minx, miny, maxx, maxy)<br>
bbox = (gt[0], miny, maxx, gt[3])<br>
<br>
..Tom<br>
</div></div></blockquote></div><br></div>