Re: [gdal-dev] Commit r19248

2010-03-31 Thread Andrey Kiselev
On Tue, Mar 30, 2010 at 08:25:07PM +0300, Ari Jolma wrote: >> I would like to read directly in the final string object. I think it could >> be done using the buffer API in recent Python branches. > > But is the string object useful from Python programmer's point of view > then? (maybe NumPy?) Ye

Re: [gdal-dev] Commit r19248

2010-03-30 Thread Christopher Barker
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

Re: [gdal-dev] Commit r19248

2010-03-30 Thread Ari Jolma
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 array

Re: [gdal-dev] Commit r19248

2010-03-30 Thread Ari Jolma
Andrey Kiselev wrote: On Mon, Mar 29, 2010 at 11:23:08PM +0300, Ari Jolma wrote: That would mean copying from the initial buffer directly into Perl arrays within a typemap - I haven't done that because of the complication of several datatypes. To change that would mean - not to break exi

Re: [gdal-dev] Commit r19248

2010-03-30 Thread Andrey Kiselev
On Mon, Mar 29, 2010 at 11:23:08PM +0300, Ari Jolma wrote: > I was wrong in saying that there are no "unnecessary" memory copies in > Perl. It seems that the raster data is copied to a buffer, from which it > is copied to another buffer maintained by Perl. I then have an extra > layer of Perl

Re: [gdal-dev] Commit r19248

2010-03-29 Thread Ari Jolma
I was wrong in saying that there are no "unnecessary" memory copies in Perl. It seems that the raster data is copied to a buffer, from which it is copied to another buffer maintained by Perl. I then have an extra layer of Perl code to copy from that buffer to Perl scalar arrays for ease of use.

Re: [gdal-dev] Commit r19248

2010-03-29 Thread Ari Jolma
Even Rouault wrote: Andrey, r19248 introduce Python specific code in general .i files. The consequence is that it breaks the Perl bindings (see http://buildbot.osgeo.org:8500/builders/telascience-quick/builds/312/steps/perl-make/logs/stdio). It also breaks Python3 compatibility as PyString_F

[gdal-dev] Commit r19248

2010-03-29 Thread Even Rouault
Andrey, r19248 introduce Python specific code in general .i files. The consequence is that it breaks the Perl bindings (see http://buildbot.osgeo.org:8500/builders/telascience-quick/builds/312/steps/perl-make/logs/stdio). It also breaks Python3 compatibility as PyString_FromStringAndSize and