1

I'm writing a pyqgis plugin with qgis 2.2 I succeeded in accessing and displaying vector data (geometries & attributes).

Now I would like to allow editing for all my layers and all features with layer’s in-memory editing buffer in order to be able in a 2nd time to commit/rollback the editions :

-> modifying features (geom & attributes) -> adding features (geom & attributes) -> deleting features (geom & attributes)

I read the qgis cookbook part called "Modifying Vector Layers with an Editing Buffer". But there is not examples showing the structure of the code. I would like to get, if possible the method I should use? Is it possible to get the structure of the code please? Which classes and which functions should i use ?

Thanks.


I'm writing a pyqgis 2.2 plugin with qgis 2.2 I succeeded in accessing and displaying vector data (geometries & attributes). I succeed also to create a 'beforecomitechanges' signal ( emitted, before changes are commited to the data provider). Thus a message has appeared into qgis logwindow ("comit change" label) after editing operations and before commiting toward the dp). Please read following piece of code allowing to do that:

def beforeLayerCommitChange(self):

QgsMessageLog.logMessage( "commit change" )

QApplication.beep()

layer.beforeCommitChanges.connect(self.beforeLayerCommitChange)

Now I would like to generate others signals. i would like generate the displaying of information messages (number of features that have been added,modifyied,deleted, the id of the features which have been modified, the name of the layer..).

COuld you throw light for me ? THanks.

closed as unclear what you're asking by underdark Jan 28 '15 at 21:10

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Do you have a starting point, or examples of code you've tried but do not work? – GISKid Jul 28 '14 at 12:51
  • I paste the following github link : github.com/picardie-nature/clicnat-qgis Thanks to this plugin, i am able to access and display data. I tried to follow the pyqgis cookbook, part "Modifying Vector Layers with an Editing Buffer". But i am not able in understanding the method, what should be the logic and structure of the code for this editing part (with buffer editing). COuld you throw light for me? – user35117 Jul 28 '14 at 13:12