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

Martin Landa landa.martin at gmail.com
Sat Aug 2 07:15:31 PDT 2014


Hi,

OGRFeature::Clone() duplicates feature. I found in API manual this
sentence: the newly created feature is owned by the caller, and will
have it's own reference to the OGRFeatureDefn.

When I try in Python:

ofeature = feature.Clone()
print feature.GetDefnRef()
print ofeature.GetDefnRef()

I am getting same reference to OGRFeatureDefn.

<osgeo.ogr.FeatureDefn; proxy of <Swig Object of type
'OGRFeatureDefnShadow *' at 0x7f86b7b84a20> >
<osgeo.ogr.FeatureDefn; proxy of <Swig Object of type
'OGRFeatureDefnShadow *' at 0x7f86b7b84a20> >

?

Thanks for clarification in advance, Martin

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


More information about the gdal-dev mailing list