R: [Gdal-dev] trivial (?) optimization for gdal.i:GDALReadRaster( )

Frank Warmerdam warmerdam at pobox.com
Thu Feb 5 14:46:22 EST 2004


Vincent Schut wrote:
> Frank / Alessandro
> 
> After some playing around I have the following results: opening and reading 
> gdal datasets works without problems using numarray. However, when I try to 
> save a numarray dataset to a file using gdal.SaveArray, I get a segfault. I'm 
> sorry but I don't know how to invoke gdb to debug a python script, so I don't 
> have much more information.
> I tried to dig up the SaveArray function and manually invoke its steps. It 
> appears that the segfault appears in the gdal.Open function on the created 
> NUMPY:::<adress> object, which is made using the gdal.OpenArray function.
> 

Vincent,

This NUMPY::: business is the magic that lets a numpy array be treated as a
gdal dataset.  It is supported by the C++ code in numpydataset.cpp that knows
about the structure used to represent a numpy object.  I think this would
have to be altered significantly for numarray though I haven't looked at the
memory structures for it.

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