Hi again and sorry for nagging, but do you have any hints as to what this error means<div><br><div><div>> return _ogr.Feature_SetField(self, *args)</div><div>> NotImplementedError: Wrong number of arguments for overloaded function</div>
<div>> 'Feature_SetField'.</div><div>> Possible C/C++ prototypes are:</div><div>> SetField(OGRFeatureShadow *,int,char const *)</div><div>> SetField(OGRFeatureShadow *,char const *,char const *)</div>
<div>> SetField(OGRFeatureShadow *,int,int)</div><div>> SetField(OGRFeatureShadow *,char const *,int)</div><div>> SetField(OGRFeatureShadow *,int,double)</div><div>> SetField(OGRFeatureShadow *,char const *,double)</div>
<div>> SetField(OGRFeatureShadow *,int,int,int,int,int,int,int,int)</div><div>> SetField(OGRFeatureShadow *,char const *,int,int,int,int,int,int,int)</div><div><br></div><div>The input to the Python bindings is of the form</div>
<div>SetField('STRUCT_DAMAGE_fraction', 0.346734256639)</div><div><br></div><div>i.e. one string argument (char*) followed by a float (double) which I thought would be matched by the third last header above. It works fine on version 1.6 but not version 1.8.</div>
<div><br></div><div>Can anyone tell me what has changed, what it means and how to work around it - please?<br><br></div><div>Many thanks</div><div>Ole</div><div><br><br><div class="gmail_quote">On Thu, Sep 1, 2011 at 7:33 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Selon Ole Nielsen <<a href="mailto:ole.moller.nielsen@gmail.com">ole.moller.nielsen@gmail.com</a>>:<br>
<div class="im"><br>
> Sorry for the addition, but regarding the issue with SetField, I just had<br>
> 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<br>
> (10.04, 10.10, 11.04). However, after installing qgis 1.7 on Ubuntu 11.04<br>
> this error keeps happening in our code. I don't know how to find out what<br>
> version of org we are using.<br>
<br>
</div>My feeling is that there must be something broken in your installation. This<br>
should work. Check that both your gdal lib and gdal python packages are updated<br>
at the same version. dpkg -l|grep gdal should give you some hints.<br>
<div><div></div><div class="h5"><br>
><br>
> Please let me know how to work around this or if there is a patch you can<br>
> apply.<br>
><br>
> Cheers and thanks<br>
> Ole<br>
><br>
><br>
><br>
> ---------- Forwarded message ----------<br>
> From: Ole Nielsen <<a href="mailto:ole.moller.nielsen@gmail.com">ole.moller.nielsen@gmail.com</a>><br>
> Date: Thu, Sep 1, 2011 at 4:04 PM<br>
> Subject: NotImplementedError: Wrong number of arguments for overloaded<br>
> 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<br>
> while on Ubuntu 10.04, 10.10 and 11.04 I saw for the first time today the<br>
> 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<br>
> write_to_file<br>
> feature.SetField(name, data[i][name])<br>
> File "/usr/lib/python2.7/dist-packages/osgeo/ogr.py", line 2184, in<br>
> SetField<br>
> return _ogr.Feature_SetField(self, *args)<br>
> NotImplementedError: Wrong number of arguments for overloaded function<br>
> '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<br>
> 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>
><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<br>
> 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>
> Ole Nielsen<br>
><br>
<br>
<br>
</div></div></blockquote></div><br></div></div></div>