[FWTools] Error in ogr.py

Frank Warmerdam warmerdam at pobox.com
Mon Dec 4 14:24:49 EST 2006

David Fawcett wrote:
> I have a script that I wrote using the ogr and osr python modules.  
> Everything runs great when I run it, but I have a user in one of our 
> other offices who keeps getting an error message.  I can't replicate it 
> using his data on my install. 
> He is running version 1.0.7 (Windows), I suspected that it could be a 
> version thing, so I uninstalled mine and installed 1.0.7. 
> The script reads X and Y values from a .csv file and writes out a 
> shapefile. 
> Here is the error that he is getting:
> D:\GIS Scripts>python csv2shp.py input=D:\convert\
> Traceback (most recent call last):
> File "csv2shp.py", line 8, in ?
> import os, ogr, sys, datetime, osr
> OverflowError: ('integer literal too large', 
> ('c:\\progra~1\\fwtool~1.7\\pymod\\
> ogr.py', 257, None, 'wkb25Bit = -2147483648 # 0x80000000\n'))
> I don't expect anyone to debug my script, I am just hoping that you can 
> tell me what cases might lead to this error. 


Is there any chance your user is not running your script in an FWTools
shell or is for some other reason not getting the right Python?

The problem appears to be support for very large constants in the python
script (in line 257 of ogr.py) and I could imagine this varying across
versions of python.  But I can't imagine it working differently with
the FWTools python on different machines.

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 FWTools mailing list