Re: [gdal-dev] Layers and features

2014-02-26 Thread Even Rouault
> I assume this is not true of the return from OGR_F_GetGeometryRef, which > needs to be cloned or it can become invalid. Yes, the geometry of a feature belongs to the feature. If you destroy the feature, the geometry becomes invalid. So you need to clone it to get a standalone version. -- Ge

Re: [gdal-dev] Layers and features

2014-02-26 Thread Tim Keitt
On Wed, Feb 26, 2014 at 3:02 PM, Even Rouault wrote: > Tim, > > > When I extract a feature from a layer, what issues arise with the > lifetime > > of the feature and the layer? If I keep the layer alive, will the feature > > continue to be valid? > > Yes, feature objects (at least at C++ objects,

Re: [gdal-dev] Layers and features

2014-02-26 Thread Even Rouault
Tim, > When I extract a feature from a layer, what issues arise with the lifetime > of the feature and the layer? If I keep the layer alive, will the feature > continue to be valid? Yes, feature objects (at least at C++ objects, not speaking about bindings) retrieved by GetNextFeature() and GetF

[gdal-dev] Layers and features

2014-02-26 Thread Tim Keitt
When I extract a feature from a layer, what issues arise with the lifetime of the feature and the layer? If I keep the layer alive, will the feature continue to be valid? If I clone a feature, is it now standalone or does it still depend on the layer/datasource in anyway? I see the note about des