[Gdal-dev] Python ReadRaster arguments

Frank Warmerdam warmerdam at pobox.com
Wed May 16 22:03:44 EDT 2007


Gregory, Matthew wrote:
> Apologies for what is likely a newbie question, but the documentation
> for gdal.Band.ReadRaster() shows this parameter list:
> 
> def ReadRaster(*args, **kwargs):
>         """
>         ReadRaster(self, int xoff, int yoff, int xsize, int ysize, int
> buf_len, 
>             int buf_xsize=0, int buf_ysize=0, int buf_type=0) -> CPLErr
>         """
>         return _gdal.Band_ReadRaster(*args, **kwargs)
> 
> However, in all the examples I have seen, it looks like the "buf_len"
> parameter is not given, e.g. (from
> http://www.gdal.org/gdal_tutorial.html):
> 
> scanline = band.ReadRaster( 0, 0, band.XSize, 1, band.XSize, 1,
> GDT_Float32 )
> 
> Can someone clarify the discrepancy?

Matt,

I'm not sure where these doc strings come from, but I believe that the
python bindings determine the buf_len internally and so it is not passed
in as a regular argument (as it would be in C).

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    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list