On lundi 28 novembre 2016 18:19:40 CET Stefan Ziegler wrote:
> Hi Even
> 
> thanks for the hint:
> 
> ERROR 6: CreateFeature : unsupported operation on a read-only datasource.
> ERROR 6: CreateFeature : unsupported operation on a read-only datasource.
> ERROR 6: CreateFeature : unsupported operation on a read-only datasource.
> ERROR 6: CreateFeature : unsupported operation on a read-only datasource.
> ERROR 6: CreateFeature : unsupported operation on a read-only datasource.
> ERROR 6: CreateFeature : unsupported operation on a read-only datasource.
> 
> I didn't know that default setting is read-only mode. Changing to
> "ogr.Open(dstConnString, 1)" works like a charm.

OK, I've reproduced a similar issue. The error/exception handling in that case 
was suboptimal 
and should have reported the original error message in the exception text. I've 
now fixed 
that in GDAL trunk and you'll get :

Traceback (most recent call last):
  File "test.py", line 6, in <module>
    lyr.CreateFeature(f)
  File 
"/home/even/gdal/trunk/gdal/swig/python/build/lib.linux-x86_64-2.7/osgeo/ogr.py",
 
line 1479, in CreateFeature
    return _ogr.Layer_CreateFeature(self, *args)
RuntimeError: CreateFeature : unsupported operation on a read-only datasource.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to