Sorry for the addition, but regarding the issue with SetField, I just had the same error with the inputs<br>SetField('STRUCT_DAMAGE_fraction', 0.346734256639)<br><br>To repeat, this works on every standard Ubuntu installation I have used (10.04, 10.10, 11.04). However, after installing qgis 1.7 on Ubuntu 11.04 this error keeps happening in our code. I don't know how to find out what version of org we are using.<br>
<br>Please let me know how to work around this or if there is a patch you can apply.<br><br>Cheers and thanks<br>Ole <br><br><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Ole Nielsen</b> <span dir="ltr"><<a href="mailto:ole.moller.nielsen@gmail.com">ole.moller.nielsen@gmail.com</a>></span><br>
Date: Thu, Sep 1, 2011 at 4:04 PM<br>Subject: NotImplementedError: Wrong number of arguments for overloaded function 'Feature_SetField'.<br>To: <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
Cc: Ariel Nunez <<a href="mailto:ingenieroariel@gmail.com">ingenieroariel@gmail.com</a>>, Ted Dunstone <<a href="mailto:ted@biometix.com">ted@biometix.com</a>><br><br><br>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 <br>
<br>....<br>ERROR 1: No such field: 'CONTENTS_DAMAGE_fraction'<br>
ERROR 1: No such field: 'STRUCT_INUNDATED'<br>ERROR 1: No such field: 'STRUCT_LOSS_AUD'<br>ERROR 1: No such field: 'CONTENTS_LOSS_AUD'<br>ERROR 1: No such field: 'PEOPLE_AFFECTED'<br>.....<br>
File "/home/nielso/dev/riab/impact/storage/vector.py", line 426, in write_to_file<br> feature.SetField(name, data[i][name])<br> File "/usr/lib/python2.7/dist-packages/osgeo/ogr.py", line 2184, in SetField<br>
return _ogr.Feature_SetField(self, *args)<br>NotImplementedError: Wrong number of arguments for overloaded function 'Feature_SetField'.<br> Possible C/C++ prototypes are:<br> SetField(OGRFeatureShadow *,int,char const *)<br>
SetField(OGRFeatureShadow *,char const *,char const *)<br> SetField(OGRFeatureShadow *,int,int)<br> SetField(OGRFeatureShadow *,char const *,int)<br> SetField(OGRFeatureShadow *,int,double)<br> SetField(OGRFeatureShadow *,char const *,double)<br>
SetField(OGRFeatureShadow *,int,int,int,int,int,int,int,int)<br> SetField(OGRFeatureShadow *,char const *,int,int,int,int,int,int,int)<br><br><br><br>This happened after I (as an unrelated act) installed qgis 1.7 so I am guessing GDAL got upgraded as well.<br>
The arguments to SetField in this case are: SetField('MMI', nan)<br>Types are <br>'MMI' <type 'str'><br>nan <type 'float'><br><br>So does this mean that nan used to be supported and no longer is?<br>
Or is it me doing something wrong.<br><br><br><br>I have seen references to this issue at <br><br><a href="http://osgeo-org.1803224.n2.nabble.com/gdal-dev-Proposed-UTF-8-SWIG-Changes-td5575272.html" target="_blank">http://osgeo-org.1803224.n2.nabble.com/gdal-dev-Proposed-UTF-8-SWIG-Changes-td5575272.html</a><br>
<a href="http://lists.osgeo.org/pipermail/gdal-dev/2010-September/026156.html" target="_blank">http://lists.osgeo.org/pipermail/gdal-dev/2010-September/026156.html</a><br><br>but they seem to be more concerned with defining typemaps in the C libraries. What I need to know is how to modify my <br>
Python code so that this runs again on all relevant gdal versions.<br><br>Can anyone help, please?<br><br>Many thanks<br><font color="#888888">Ole Nielsen<br><br>
</font></div><br>