Thank you very much for replying.<br>The output I got from you suggestion is<br><br>nielso@shakti:~$ dpkg -l|grep gdal<br>ii gdal-bin 1.8.0-2~natty2 Geospatial Data Abstraction Library - Utility programs<br>
ii libgdal1-1.6.0 1.6.3-4build3 Geospatial Data Abstraction Library<br>ii libgdal1-1.6.0-grass 1.6.3-3 GRASS extension for the GDAL library<br>
ii libgdal1-1.8.0 1.8.0-2~natty2 Geospatial Data Abstraction Library<br>ii python-gdal 1.8.0-2~natty2 Python bindings to the Geospatial Data Abstraction Library<br>
<br><br>I think the versions 1.6 would be those coming natively with Ubuntu Natty while the 1.8 stream may have been installed by qgis 1.7<br>Is there a way of telling which one I am using (both when running commandline org2org and when importing the ogr module in python)?<br>
<br>Cheers and thanks<br>Ole <br><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>