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

Even Rouault even.rouault at mines-paris.org
Sat Aug 2 13:18:05 PDT 2014


Le samedi 02 août 2014 22:12:35, Martin Landa a écrit :
> Hi,
> 
> 2014-08-02 22:03 GMT+02:00 Even Rouault <even.rouault at mines-paris.org>:
> > The documentation meant that Clone() will return a new standalone
> > feature, but that will also increment the reference counter of the
> > related OGRFeatureDefn (as new OGRFeature(poFeatureDefn) would do).
> 
> truly to say, it doesn't explain me why the both features points to
> the same OGRFeatureDefn. 

Well, that's by design...


> Anyway, I need to solve problem explained
> bellow:
> 
> 1) copy features from input layer to output layer
> 2) modify features in output layer (remove some geometry columns)

You can use the SetFrom() method.

> 
> How correctly I should do it? Thanks in advance, Martin

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html


More information about the gdal-dev mailing list