[gdal-dev] Fwd: NotImplementedError: Wrong number of arguments for overloaded function 'Feature_SetField'.

Even Rouault even.rouault at mines-paris.org
Tue Sep 6 02:05:38 EDT 2011


>    - What are the official ogr steps required to store a vector layer
>    (represented as e.g. a list of x, y values and associated feature
> attributes (name, value))? In particular, is CreateField perhaps obsoleted
> by something else?

Nothing obsoleted here. CreateField() and CreateFeature() are the way to go

>    - Is the truncation to 10 characters hard and fast or driver dependent -
>    and how should one deal with this truncation? Your example (which does
> not use CreateField) would suggest names can be longer than 10 characters.

Yes, it is specific to the shapefile driver. This is a in fact a limitation of 
the DBF format itself : http://www.gdal.org/ogr/drv_shapefile.html

And the implementation of the truncation has indeed changed in recent 
versions. I somehow remember that in previous versions CreateField() only 
truncated in the field name in the DBF file but not in the feature definition 
just after calling it. Now its behaviour is more consistant, but can indeed be 
a bit strange where one is not aware of it.

> - Where can i find some documentation of the OGR Python bindings?

You'll find a lot of ressources here :
http://trac.osgeo.org/gdal/wiki/GdalOgrInPython

Best regards,

Even


More information about the gdal-dev mailing list