[gdal-dev] gdal swig python ReadAsArray limit

Frank Warmerdam warmerdam at pobox.com
Thu Oct 30 20:51:46 EDT 2008


Jared Rubin wrote:
> GDAL community,
>   I am using the python bindings to gdal. I am unable to read a whole
> NITF image that is 25600x19200 and UInt16 in one call to ReadAsArray
> I end up getting a core dump. I can open smaller size images.
> 
> Does gdal have a size limit on the python/numpy interface?
> 
> 
> inSet = gdal.OpenShared(args[0])
> buf = inSet.GetRasterBand(1).ReadAsArray()

Jared,

First, that's a 9.8GB array.  So I assume you are working in a 64bit
build of the software.  Personally I just don't think you ought to be
treating images this large as single chunks to be thrown around and
operated on with numpy.

Second, there was a bug in the some part of GDAL in 1.5.0 (fixed by
1.5.3 I think) that made it impossible to read into a memory buffer
larger than 2GB - though there was no problem with large datasets.

So, if you really want to do this, I'd suggest upgrading to 1.5.3 or
even GDAL 1.6.0 beta1.  Try again.  If things still crash consider
filing a ticket though I don't personally have hardware that would
less me work out this sort of a problem effectively.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list