[gdal-dev] python downsample API?

K.-Michael Aye kmichael.aye at gmail.com
Wed Apr 11 10:31:14 EDT 2012


Dear all,

is there a Python API for downsampling a huge dataset?
What I would like to do:

* get my dataset
* read out RasterXSize and RasterYSize
* calculate how many lines and rows I need to skip to get a quick 
overview image, e.g. 10 lines to skip.
* Have a ReadAsArray interface where I can say something like this:
** data = ds.ReadAsArray(xoffset, yoffset, 10000, 10000, skipping=10)

which in numpy terms would give me every 10nth line like this: array[:,:,10]

I really don't need quality at all, just speed, for a rough overview 
for further zooming in with lassos, as the images I deal with sometimes 
have more than 200 MPixels.

Is this possible in Python?
I was thinking now, maybe one could use numpy's memmap somehow for 
this, don't know much about it, though…

Thanks for any hints!

Best regards,
Michael




More information about the gdal-dev mailing list