[gdal-dev] question about ReadAsArray

Matt Funk mafunk at nmsu.edu
Mon Dec 13 17:33:58 EST 2010


Hi,

i am a bit new to the gdal library. I am trying to process some geotiff
files in python.

1) I am making a call to the ReadAsArray data as such:
...
band = ds.GetRasterBand(1)
array = band.ReadAsArray(0,0,band.XSize,band.YSize)
print array.shape
...
which returns: (7191, 8331)
Now, what i don't understand is that when i do:
...
print 'Size is ',ds.RasterXSize,'x',ds.RasterYSize, 'x',ds.RasterCount
...
i get: Size is  8331 x 7191 x 1

So does that mean that ReadAsArray returns the an array that has its
dimensions flipped?


2) Where can i find the documentation for the ReadAsArray fcn?


thanks
matt




More information about the gdal-dev mailing list