Re: [Qgis-developer] Keep track of features in memory provider

2013-11-19 Thread Matthias Kuhn
On 19.11.2013 09:12, Radim Blazek wrote: > On Mon, Nov 18, 2013 at 8:58 PM, Matthias Kuhn wrote: As far as I know, currently the most appropriate thing is to use layer.dataProvider().addFeatures() and to skip the edit buffer. >>> That is what I am doing, but QgsMemoryProvider::addFeature

Re: [Qgis-developer] Keep track of features in memory provider

2013-11-19 Thread Matthias Kuhn
On Die 19 Nov 2013 09:15:55 CET, Jürgen E. Fischer wrote: > Hi Matthias, > > On Mon, 18. Nov 2013 at 20:58:04 +0100, Matthias Kuhn wrote: >> I think we should rather fix this issue. I would very much like >> QgsVectorLayer to emit a signal, when it commits the features and >> changes their ids. >>

Re: [Qgis-developer] Keep track of features in memory provider

2013-11-19 Thread Jürgen E . Fischer
Hi Matthias, On Mon, 18. Nov 2013 at 20:58:04 +0100, Matthias Kuhn wrote: > I think we should rather fix this issue. I would very much like > QgsVectorLayer to emit a signal, when it commits the features and > changes their ids. > > QgsVectorLayer::featureIdsChanged( QMap< QgsFeatureId, QgsFeat

Re: [Qgis-developer] Keep track of features in memory provider

2013-11-19 Thread Radim Blazek
On Mon, Nov 18, 2013 at 8:58 PM, Matthias Kuhn wrote: >>> As far as I know, currently the most appropriate thing is to use >>> layer.dataProvider().addFeatures() and to skip the edit buffer. >> >> That is what I am doing, but QgsMemoryProvider::addFeatures() >> overwrites original feature id. > >

Re: [Qgis-developer] Keep track of features in memory provider

2013-11-18 Thread Denis Rouzaud
On 18. 11. 13 20:58, Matthias Kuhn wrote: I think we should rather fix this issue. I would very much like QgsVectorLayer to emit a signal, when it commits the features and changes their ids. QgsVectorLayer::featureIdsChanged( QMap< QgsFeatureId, QgsFeatureId ) So you could connect to this and

Re: [Qgis-developer] Keep track of features in memory provider

2013-11-18 Thread Matthias Kuhn
On Mon 18 Nov 2013 19:36:22 CET, Radim Blazek wrote: > On Mon, Nov 18, 2013 at 6:44 PM, Matthias Kuhn wrote: >> As far as I know, currently the most appropriate thing is to use >> layer.dataProvider().addFeatures() and to skip the edit buffer. > > That is what I am doing, but QgsMemoryProvider::ad

Re: [Qgis-developer] Keep track of features in memory provider

2013-11-18 Thread Radim Blazek
On Mon, Nov 18, 2013 at 6:44 PM, Matthias Kuhn wrote: > As far as I know, currently the most appropriate thing is to use > layer.dataProvider().addFeatures() and to skip the edit buffer. That is what I am doing, but QgsMemoryProvider::addFeatures() overwrites original feature id. Another issue w

Re: [Qgis-developer] Keep track of features in memory provider

2013-11-18 Thread Matthias Kuhn
As far as I know, currently the most appropriate thing is to use layer.dataProvider().addFeatures() and to skip the edit buffer. But I think that layers should broadcast information about changing feature ids. This is not a problem unique to the memory provider. Matthias On Mon 18 Nov 2013 17:

[Qgis-developer] Keep track of features in memory provider

2013-11-18 Thread Radim Blazek
Is there a trick how to keep track of features added to memory provider? Say that feature with id is added to a memory provider. Original id is overwritten by the memory provider. How to access the feature in the provider by original id without additional attribute or hacks like counting mNextFeat