[Gdal-dev] OGR python FeatureDefn constructor

Frank Warmerdam warmerdam at pobox.com
Wed Mar 31 10:34:41 EST 2004


Julien Demaria wrote:
> Hi,
> 
> In ogr.py, the FeatureDefn constructor use an undeclared "name" attribute :
> 
> class FeatureDefn:
> 
>     def __init__(self,obj=None):
>         if obj is None:
>             self._o = _gdal.OGR_FD_Create( name )
>         else:
>             self._o = obj

Julien,

Hmm, clearly that has never been tested.  I have changed it to the following
without any testing:

class FeatureDefn:

     def __init__(self,obj=None,name='unnamed'):
         if obj is None:
             self._o = _gdal.OGR_FD_Create( name )
         else:
             self._o = obj


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