[SciPy-user] StandardError: 'NoneType' object has no attribute '_o'

Vincent Schut schut@sarvision...
Thu Sep 6 02:46:15 CDT 2007


Sandric,

I'm forwarding your message to the gdal mailing list, because this seems
merely related to gdal, less to numpy.
Btw, if you are mainly using numpy arrays instead of (deprecated)
numeric arrays, you might want to look into gdal_array.py, which links
gdal to numpy, instead of gdalnumeric.py, which links gdal to numeric.
Though I don't know if that is provided on windows binary builds by
default, being a linux-only user... Someone on the gdal list will know,
probably.

Vincent.

sandric ionut wrote:
> Hi:
> I am using Gdal 142 version on Windows XP sp2 with Numeric-24.2, SciPy
> 0.5.2.1, numpy 1.0.3.1. for Python 2.4.
> I want to use genericfunctions from scipy.ndimage. I have tried with
> the example provided in numarray users' manual release 1.5:
> >>> def fnc(iline, oline):
> ... oline[...] = iline[:-2] + 2 * iline[1:-1] + 3 * iline[2:]
> ...
> >>> print generic_filter1d(a, fnc, 3)
> [[ 3 8 14 17]
> [27 32 38 41]
> [51 56 62 65]]
>
> Everything works OK and I get the proper result, but when I try to use
> gdalnumeric to save the array to a image format (tif for example, or
> any other format supported by gdal) I get the following error:
>
>   File "C:\Python24\Lib\site-packages\gdalnumeric.py", line 123, in
> SaveArray
>     return driver.CreateCopy( filename, OpenArray(src_array,prototype) )
>   File "C:\Python24\Lib\site-packages\gdal.py", line 592, in CreateCopy
>     target_ds = _gdal.GDALCreateCopy( self._o, filename, source_ds._o,
> StandardError: 'NoneType' object has no attribute '_o'
> How can I save an array into a image format supported by Gdal
> I don't know what I do wrong
>
> Thank you
>
> Ionut
>
> ------------------------------------------------------------------------
> Need a vacation? Get great deals to amazing places
> <http://us.rd.yahoo.com/evt=48256/*http://travel.yahoo.com/;_ylc=X3oDMTFhN2hucjlpBF9TAzk3NDA3NTg5BHBvcwM1BHNlYwNncm91cHMEc2xrA2VtYWlsLW5jbQ-->on
> Yahoo! Travel.
> ------------------------------------------------------------------------
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>   



More information about the SciPy-user mailing list