[gdal-dev] BandReadAsArray speed up

Howard Butler hobu.inc at gmail.com
Mon Feb 23 19:54:39 EST 2009

On Feb 23, 2009, at 5:32 PM, Gong, Shawn (Contractor) wrote:

> hi list,
> I am reading the image data for a bandobj, using BandReadAsArray()  
> which works, but it is sometimes slow.
> Is it actually reading from the file?  Is there a way to access the  
> image data that is already in memory, or anything else I could do to  
> speed it up?

BandReadAsArray has regressed a bit from old-gen bindings to new-gen  
bindings.  Specifically, it is reallocating every time a read happens  
instead of allowing you to fill an already existing array.  This might  
give you a significant speedup depending on your circumstances.  I  
hope to fix this bug at the Toronto sprint.




More information about the gdal-dev mailing list