[Gdal-dev] Tiger Polygons

Frank Warmerdam warmerdam at pobox.com
Tue Mar 4 22:56:18 EST 2003


Thomas Hargrove wrote:
> Thanks for the response.  I got the newest CVS of GDAL and installed it.
> 
> I had to add "#include <assert.h>" to  gdal_wrap.c to get python 1.5 to
> work.
> 
> This is the error I get with either python 1.5 or 2.2:
> 
> [root at localhost ogr]# python tigerpoly.py in/ out/
> Traceback (innermost last):
>   File "tigerpoly.py", line 98, in ?
>     ds = ogr.Open( infile, update = 0 )
>   File "/usr/lib/python1.5/site-packages/ogr.py", line 107, in Open
>     ds_o = _gdal.OGROpen( filename, update, None )
> TypeError: OGROpen, argument 3: expected string, None found
> 
> Any ideas?

Tom,

Arggg.  I believe this is related to the version of swig used to generate
the gdal_wrap.c.  I would suggest deleting the gdal_wrap.c you have,
doing a cvs update, and then touching the new one so that the makefile won't
try to regenerate it.

It seems to be an issue about whether the swig wrappers consider None to
mean NULL in C.  At least one specific version of swig does (the one I usually
use), but others do not (like what I have on my new redhat system).

If the above doesn't solve the problem let me know.  I will be committing a
version of ogr.py that tries to handle the need for 'NULL' gracefully.

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