[FWTools] Working with shapefile using python binding

Frank Warmerdam warmerdam at pobox.com
Fri Jan 27 11:08:14 EST 2006


On 1/27/06, Moreau, Jean-Sebastien <jmoreau at nrcan.gc.ca> wrote:
> Hi list!
>
> I'm trying to work with some shapeFiles using the python binding library.
> Unfortunately, when I run the following commands in python I get this error
> message:
>
> >>>import ogr
> >>>driver=ogr.GetDriverByName('ESRI ShapeFile')
> Unexpected Error
> Type: ogr.OGRError
> Description: Unable to find ogr.Driver named "ESRI ShapeFile".

Jean-Sébastien,

To my shock I have discovered this call seems to be case
sensitive.  Try instead:

driver = ogr.GetDriverByName( 'ESRI Shapefile' )

I will look into correcting the code to be case insensitive in
this call as I try to do for most of my code.

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