Le lundi 04 août 2014 12:46:22, Martin Landa a écrit : > Hi Even, > > 2014-08-02 22:18 GMT+02:00 Even Rouault <[email protected]>: > > [...] > > > You can use the SetFrom() method. > > it solved my problem, but it doesn't seems to copy geometry columns... > > """ > ofeature = ogr.Feature(olayer.GetLayerDefn()) > ofeature.SetFrom(feature) > print feature.GetDefnRef().GetGeomFieldCount(), > feature.GetDefnRef().GetFieldCount() > print ofeature.GetDefnRef().GetGeomFieldCount(), > ofeature.GetDefnRef().GetFieldCount() > """ > > 2 31 > 0 31 <-- 0!!!
Perhaps check that the line olayer.CreateGeomField(feat_defn.GetGeomFieldDefn(i)) is executed and its return code is 0. Also, when running CreateLayer() with geom_type != wkbNone, this will create a default geometry field, which might get recreated again in your geometry field creation loop. But it does not look like like it is the case in your situation. > > Martin -- Geospatial professional services http://even.rouault.free.fr/services.html _______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
