[gdal-dev] python downsample API?

Etienne Tourigny etourigny.dev at gmail.com
Wed Apr 11 11:28:17 EDT 2012


This might be overkill, but would using gdal to create an overview be
suitable for you?

You could call gdaladdo or use the API (BuildOverviews)
http://www.gdal.org/classGDALDataset.html#a2aa6f88b3bbc840a5696236af11dde15

Etienne
On Wed, Apr 11, 2012 at 11:31 AM, K.-Michael Aye <kmichael.aye at gmail.com> wrote:
> 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
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list