[gdal-dev] Commit r19248

Christopher Barker Chris.Barker at noaa.gov
Tue Mar 30 17:05:56 EDT 2010


Ari Jolma wrote:
> The point is that the byte buffer may contain data basically in any 
> GDALDataType (that's an argument to ReadRaster). The receiving end needs 
> to know what's the type to understand the bytes object. Perl data buffer 
> objects do not carry that information, and it seems that Python bytes 
> object do neither (http://www.python.org/dev/peps/pep-3137/).

Correct, it's up the user to make sure that they have what they think 
they have.

However, there is a new buffer object in Python 3 (and back-ported to 
2.6 and 2.7) that does define what the data type is (and, indeed, its 
shape):

http://www.python.org/dev/peps/pep-3118/

That's really what GDAL should use but it may have to wait for when 
support for older Pythons is not needed. I have no idea if anyone has 
written SWIG typemaps for that yet.

-Chris







-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov


More information about the gdal-dev mailing list