[gdal-dev] feature.clone() -> same featuredefn

Martin Landa landa.martin at gmail.com
Mon Aug 4 03:46:22 PDT 2014


Hi Even,

2014-08-02 22:18 GMT+02:00 Even Rouault <even.rouault at mines-paris.org>:

[...]

> 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!!!

Martin

-- 
Martin Landa * http://geo.fsv.cvut.cz/gwiki/Landa


More information about the gdal-dev mailing list