Hi Michael,<div><br></div><div><br></div><div>I may be missing your question, but why aren&#39;t you just using ReadAsArray?  It has an option to return a smaller array from the input array.  Now, I&#39;m not sure how it does the resampling (you could look to see), but you can make a call like</div>
<div><br></div><div>data = banddata.ReadAsArray(0,0,filehandle.RasterXSize,filehandle.RasterYSize,xsize,ysize)</div><div><br></div><div>where xsize and ysize are smaller than the true RasterXSize or RasterYSize.  I haven&#39;t looked at this in a while, but I&#39;m pretty sure this will work.  Did I miss the point of what you were asking?</div>
<div><br></div><div><br></div><div>Thanks,</div><div>Scott</div><div><br><br><div class="gmail_quote">On Wed, Apr 11, 2012 at 6:31 AM, K.-Michael Aye <span dir="ltr">&lt;<a href="mailto:kmichael.aye@gmail.com">kmichael.aye@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear all,<br>
<br>
is there a Python API for downsampling a huge dataset?<br>
What I would like to do:<br>
<br>
* get my dataset<br>
* read out RasterXSize and RasterYSize<br>
* calculate how many lines and rows I need to skip to get a quick overview image, e.g. 10 lines to skip.<br>
* Have a ReadAsArray interface where I can say something like this:<br>
** data = ds.ReadAsArray(xoffset, yoffset, 10000, 10000, skipping=10)<br>
<br>
which in numpy terms would give me every 10nth line like this: array[:,:,10]<br>
<br>
I really don&#39;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.<br>
<br>
Is this possible in Python?<br>
I was thinking now, maybe one could use numpy&#39;s memmap somehow for this, don&#39;t know much about it, though…<br>
<br>
Thanks for any hints!<br>
<br>
Best regards,<br>
Michael<br>
<br>
<br>
______________________________<u></u>_________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/gdal-dev</a><br>
</blockquote></div><br><br><br>
</div>