[Gdal-dev] GDALNumeric.SaveArray : Unable to access numpy arrays of typecode "@"

Frank Warmerdam warmerdam at pobox.com
Fri Sep 26 12:03:05 EDT 2003


Gagan Tandon wrote:

> Dear Friends,
> 
> I am using Numeric 23.0 version and python 2.3 on a windows XP machine. 
> I have build GDAL from MS VC++ and Visual Studio .net and installed on 
> my machine. The GDAL version is 1.1.9.
> 
> Basic Problem : I am trying to save a Numpy array(infact the primary 
> issue is to save any 2d array (not just NUMPY) to a "TIF" file) to a TIF 
> file. When I run the following commands, I get an error stating that it 
> cannot access Numpy array of typecode "@"  (weird..??)

Gagan,

As Gillian mentioned this is a problem with using internal definitions for
array structures and enumerations.  The default build on windows was doing
this.

I have changed things around a bit to deal with this better:
  o By default HAVE_NUMPY is now defined in nmake.opt.  If you have python
    but not Numeric includes files on your system, you would need to comment
    this out to build.  This should ensure that we *normally* get the right
    definitions from now on in windows builds.

  o I have modified gdal_py.py to include a more recent list of the numpy
    type codes, which is enough to fix this problem for some situations.

  o I have modified the Open() method of the NUMPY driver to issue a warning
    explaining the issue if we called with an "internal definitions" build.

So, you can update from CVS and rebuild or just do the change that Gillian
suggested.  Hopefully people will stop running into this problem after the
next major release.

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