[Gdal-dev] Gettting Image Resolution

Frank Warmerdam warmerdam at pobox.com
Sun Mar 2 12:21:35 EST 2003


Ayman Kamal wrote:
> How can I get the resolution of the image using GDAL?


Hi,

I assume you are wanting the size of a pixel in georeferenced coordinates?
If so, use the GetGeoTransform() method on the GDALDataset. It fills in a
six parameter double array.  geotransform[1] is normally the width of a
pixel, and geotransform[5] is usually the height of a pixel negated.
If the image is rotated things are more complicated.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the Gdal-dev mailing list