[gdal-dev] Commit r19248
ari.jolma at gmail.com
Tue Mar 30 15:57:40 EDT 2010
Christopher Barker wrote:
> Ari Jolma wrote:
>> But is the string object useful from Python programmer's point of
>> view then? (maybe NumPy?)
> yes, a python string (or, in newer versions, a bytes object) can be
> used to create various objects with compatible binary represent ions:
> images, numpy arrays, etc. without copying, thanks to the buffer
> Of course, creating a numpy array in the first place is best, but not
> everyone wants to use numpy.
> Not sure what bearing this has on the wrapper, though...
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/).
More information about the gdal-dev