[Qgis-developer] Remove Feature

2012-02-28 Thread Alexandre Badez
Hi everyone, I'm coding a plugin in python and I would like to understand what append during this: self._layer.dataProvider().deleteFeatures([v.id() for v in self._object_map.itervalues()]) and self._layer.dataProvider().addFeatures([v for v in self._object_map.itervalues()]) because featu

[Qgis-developer] Remove Feature

2012-03-01 Thread Alexandre Badez
Hi everyone, I would like to remove feature in a vector layer, but the deleteFeatures do not seems to work. Is it a bug ? How can I do this ? How should I handle features ids ? Thanks. -- Alex ___ Qgis-developer mailing list Qgis-developer@lists.osg

Re: [Qgis-developer] Remove Feature

2012-03-01 Thread Alexandre Badez
rom > vectorLayer ? > > On 03/01/2012 10:54 AM, Alexandre Badez wrote: >> >> Hi everyone, >> >> I would like to remove feature in a vector layer, but the >> deleteFeatures do not seems to work. >> >> Is it a bug ? How can I do this ? >

Re: [Qgis-developer] Remove Feature

2012-03-01 Thread Alexandre Badez
/3nids/Triangulation/blob/2b90973a34f835ac3564204dcbccc573bcff274a/triangulation.py > > > same for addFeatures. > > Which version of Qgis are you using? > > > > > On 03/01/2012 11:38 AM, Alexandre Badez wrote: > > Hi, > > Yep, I did, and it did not

Re: [Qgis-developer] Remove Feature

2012-03-02 Thread Alexandre Badez
Thanks Martin for your help. On Thu, Mar 1, 2012 at 21:28, Martin Dobias wrote: > The actual implementation is in classes derived from > QgsVectorDataProvider. Each data provider that allows adding/deleting > features has its own logic. Ok... I'm using the memory data provider (I'm creating my l

Re: [Qgis-developer] Remove Feature

2012-03-02 Thread Alexandre Badez
THANKS IT WORKS ! \o/ On Fri, Mar 2, 2012 at 10:25, Martin Dobias wrote: > On Fri, Mar 2, 2012 at 10:14 AM, Alexandre Badez > wrote: >> So I try do delete features as this: >>            f = core.QgsFeature() >>            fids = [] >>    

Re: [Qgis-developer] pointers in PyQt

2012-03-07 Thread Alexandre Badez
Hi, Try None. On Wed, Mar 7, 2012 at 10:28, Denis Rouzaud wrote: > Hi, > > In the QgsRubberBand.addGeometry , we can specify a 0 pointer for the layer > if we don't need its the coord transformation. > > How can I do this in python? > > I tried > self.rubber.addGeometry( geom , 0 ) > > but, of c

Re: [Qgis-developer] idea for settings

2012-03-09 Thread Alexandre Badez
Hi, By the way instead of: if self.defaultValue.has_key(setting) is False You should write this: if setting not in self.defaultValue: It's more "pythonic" and work with list, tuple, set and every things that implement the __contains__ method ( http://docs.python.org/reference/datamodel.h