[gdal-dev] NotImplementedError: Wrong number of arguments for
overloaded function 'Feature_SetField'.
Ole Nielsen
ole.moller.nielsen at gmail.com
Thu Sep 1 05:04:45 EDT 2011
Developing on a code which relies on ogr.py and that has been running for a
while on Ubuntu 10.04, 10.10 and 11.04 I saw for the first time today the
error
....
ERROR 1: No such field: 'CONTENTS_DAMAGE_fraction'
ERROR 1: No such field: 'STRUCT_INUNDATED'
ERROR 1: No such field: 'STRUCT_LOSS_AUD'
ERROR 1: No such field: 'CONTENTS_LOSS_AUD'
ERROR 1: No such field: 'PEOPLE_AFFECTED'
.....
File "/home/nielso/dev/riab/impact/storage/vector.py", line 426, in
write_to_file
feature.SetField(name, data[i][name])
File "/usr/lib/python2.7/dist-packages/osgeo/ogr.py", line 2184, in
SetField
return _ogr.Feature_SetField(self, *args)
NotImplementedError: Wrong number of arguments for overloaded function
'Feature_SetField'.
Possible C/C++ prototypes are:
SetField(OGRFeatureShadow *,int,char const *)
SetField(OGRFeatureShadow *,char const *,char const *)
SetField(OGRFeatureShadow *,int,int)
SetField(OGRFeatureShadow *,char const *,int)
SetField(OGRFeatureShadow *,int,double)
SetField(OGRFeatureShadow *,char const *,double)
SetField(OGRFeatureShadow *,int,int,int,int,int,int,int,int)
SetField(OGRFeatureShadow *,char const *,int,int,int,int,int,int,int)
This happened after I (as an unrelated act) installed qgis 1.7 so I am
guessing GDAL got upgraded as well.
The arguments to SetField in this case are: SetField('MMI', nan)
Types are
'MMI' <type 'str'>
nan <type 'float'>
So does this mean that nan used to be supported and no longer is?
Or is it me doing something wrong.
I have seen references to this issue at
http://osgeo-org.1803224.n2.nabble.com/gdal-dev-Proposed-UTF-8-SWIG-Changes-td5575272.html
http://lists.osgeo.org/pipermail/gdal-dev/2010-September/026156.html
but they seem to be more concerned with defining typemaps in the C
libraries. What I need to know is how to modify my
Python code so that this runs again on all relevant gdal versions.
Can anyone help, please?
Many thanks
Ole Nielsen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110901/1a7befb7/attachment.html
More information about the gdal-dev
mailing list