[Gdal-dev] tigerpoly.py GetLayerByName

Frank Warmerdam fwarmerdam at gmail.com
Thu Mar 10 12:21:17 EST 2005


On Thu, 10 Mar 2005 11:14:09 -0600, Simpson <asimpson at i-55.com> wrote:
> Greetings,
> 
> I am trying to run tigerpoly.py but keep getting:
> 
>  ./tigerpoly.py TGR06001.RT1 test.shp
> Traceback (most recent call last):
>   File "./tigerpoly.py", line 97, in ?
>     poly_layer = ds.GetLayerByName( 'Polygon' )
> AttributeError: DataSource instance has no attribute 'GetLayerByName'
> 
> Having not a clue about python, is this a data issue?
> 
> Using gdal-1.2.6b3 on Linux 2.4.20-20.8

Drew,

GetLayerByName() isn't a particularly recent addition. 
My guesses are:
 o You have quite old Python bindings for GDAL installed
    somewhere and they are getting used instead of the 
    new ones.  Try "locate gdal.py" and see if you get any
    surprising items.  Compare the found files to the gdal.py
    in the gdal-1.2.6b3/pymod directory.  Do they match/

 o "ds" is None because the open on the datasource failed. 

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